smarty在引导文件中引入:include_once ("../library/Smarty/Smarty.class.php");$smarty = new Smarty ();$smarty->caching = false;$smarty->template_dir = APPLICATION_PATH."application/views/scripts/";$smarty->compile_dir = "./data/smarty/";$smarty->cache_dir = "./data/smarty/cache_c/";//$smarty->left_delimiter = "<{";//$smarty->right_delimiter = "}>";require_once "Zend/Loader/Autoloader.php";Zend_Loader_Autoloader::getInstance ()->setFallbackAutoloader ( true );$registry = Zend_Registry::getInstance ();$registry->set ( 'smarty', $smarty );引入期间前端控制器的配置:$front = Zend_Controller_Front::getInstance ();$front->setBaseUrl ( '/' );$front->setParam ( 'useDefaultControllerAlways', true );$front->setParam ( 'noViewRenderer', true );$front->setControllerDirectory ( '../application/controllers' );$front->throwExceptions ( true );$this->view 在控制器中配置:$this->registry = Zend_Registry::getInstance ();$this->view = $this->registry ['smarty'];$this->view->assign ( 'baseurl', $this->_request->getBaseUrl () );
详细解决方案
php之smarty篇(1)-smarty引入
热度:51 发布时间:2016-04-29 00:14:47.0
相关解决方案
- zend framework2 集成 smarty 文件
- smarty 数据库查询有关问题
- Smarty 的控制器怎么调用其他文件的方法
- smarty section,该如何处理
- smarty 模板路径有关问题
- smarty 模版中,js修改了表单的值,如其直接在模版中用该表单值进行if语句判断
- smarty 遍历多维数组有关问题
- smarty 揭示403
- smarty 截取字符串,调用php中的步骤,foreach循环
- smarty 如何在模板上循环遍历输出三维数据?
- smarty tpl 循环,该怎么解决
- smarty 模板编辑器,该怎么解决
- smarty 如若给模板传值是动态的,生成缓存 也是动态
- smarty 怎么实现i++
- smarty 循环,该怎么解决
- PHP(三): Start using Smarty
- smarty 截取字符串解决方法
- php+smarty 为什么在IE上正常,在火狐+IE9上全是源代码?
- smarty 新手
- smarty 在include file 包含动态内容的时候报错(http 500),该如何处理
- smarty 和 iframe 的有关问题
- smarty 页面空缺
- php smarty 缓存施用
- php smarty foreach name index first last etc
- smarty 截取字符串解决思路
- smarty options汉语言显示不正常
- smarty,该如何解决
- Fatal error: Smarty error:syntax error: unrecognized tag,该怎么解决
- smarty 怎么调用 php类的常量成员
- smarty 在include file 包孕动态内容的时候报错(http 500)