Smarty of php (1) -- smarty introduces smarty into the boot File: include_once (".. /library/Smarty. class. php "); $ smarty = newSmarty (); $ smarty-smarty of php (1) -- Introduction of smarty
Smarty introduced in the Boot File: include_once (".. /library/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 ); frontend controller configuration during Import: $ front = Zend_Controller_Front: getInstance (); $ front-> setBaseUrl ('/'); $ front-> setParam ('usedefacontrolleralway ', true); $ front-> setParam ('noviewrenderer', true); $ front-> setControllerDirectory ('.. /application/controllers '); $ front-> throwExceptions (true); $ this-> view configuration in the controller: $ this-> registry = Zend_Registry: getInstance (); $ this-> view = $ this-> registry ['smarty ']; $ this-> view-> assign ('baseurl ', $ this-> _ request-> getBaseUrl ());