php之smarty篇--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实现验证码的识别(初级篇)
下一篇: MySQL 数据库存储引擎_MySQL
推荐阅读
-
php smarty中文截取插件开发示例_PHP教程
-
Codeigniter中集成smarty和adodb的方法,codeignitersmarty_PHP教程
-
PHP+jQuery 注册模块的改进(三):更新到Smarty3.1_php实例
-
smarty_PHP教程
-
PHP中获得$Smarty.capture.name截获的输出_PHP教程
-
smarty模板引擎从php中获取数据的方法
-
Smarty模æ¿ç®åé ç½®ä¸ä½¿ç¨æ¹æ³ç¤ºä¾ï¼smarty模æ¿ç¤ºä¾_PHPæç¨
-
php中smarty区域循环的方法,phpsmarty区域循环
-
php-jquery局部刷新接收数据Smarty重新执行
-
Smarty使用自定义资源的方法,smarty自定义资源_PHP教程