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 () );