Zend frameworkViewI don't want to use it for a short time. I still like it.Smarty.
First download the smarty, decompress it, andLibsCopy the folder and its content toLibraryDirectory, I like to change the name and rename itSmarty.
Open the application. ini file and add a line to configure resources. frontcontroller. noviewrenderer = 1 to disable the default Zend frameworkView.
Add smarty configuration information
{
Function onclick ()
{
This. style. display = 'none'; document. getelementbyid ('Code _ closed_text_102159 '). style. display = 'none'; document. getelementbyid ('Code _ open_image_102159 '). style. display = 'inline'; document. getelementbyid ('Code _ open_text_102159 '). style. display = 'inline ';
}
} "Id =" code_closed_image_102159 "style =" display: none "> {
Function onclick ()
{
This. style. display = 'none'; document. getelementbyid ('Code _ open_text_102159 '). style. display = 'none'; getelementbyid ('Code _ closed_image_102159 '). style. display = 'line'; getelementbyid ('Code _ closed_text_102159 '). style. display = 'inline ';
}
} "Id =" code_open_image_102159 "> Smarty
[ Staging: Production ]
Smarty. class_path = " Smarty/smarty. Class. php "
Smarty. left_delimiter = " <* "
Smarty. right_delimiter = " *> "
Smarty. template_dir = " Template "
Smarty. compile_dir = " Compile "
Smarty. cache_dir = " Cache "
Smarty. cache_lifetime = 600
Smarty. caching = 1
Open the Bootstrap. php file and add a function to initialize smarty.
{
Function onclick ()
{
This. style. display = 'none'; document. getelementbyid ('Code _ closed_text_102337 '). style. display = 'none'; document. getelementbyid ('Code _ open_image_102337 '). style. display = 'inline'; document. getelementbyid ('Code _ open_text_102337 '). style. display = 'inline ';
}
} "Id =" code_closed_image_102337 "style =" display: none "> {
Function onclick ()
{
This. style. display = 'none'; document. getelementbyid ('Code _ open_text_102337 '). style. display = 'none'; getelementbyid ('Code _ closed_image_102337 '). style. display = 'inline'; getelementbyid ('Code _ closed_text_102337 '). style. display = 'inline ';
}
} "Id =" code_open_image_102337 "> _ Initview
Public Function _ Initview (){
$ Config = New Zend_config_ini (config_file_path , ' Staging ' );
Require_once $ Config -> Smarty -> Class_path;
$ Smarty = New Smarty ();
$ Smarty -> Left_delimiter = $ Config -> Smarty -> Left_delimiter;
$ Smarty -> Right_delimiter = $ Config -> Smarty -> Right_delimiter;
$ Smarty -> Template_dir = $ Config -> Smarty -> Template_dir;
$ Smarty -> Compile_dir = $ Config -> Smarty -> Compile_dir;
$ Smarty -> Cache_dir = $ Config -> Smarty -> Cache_dir;
$ Smarty -> Cache_lifetime = $ Config -> Smarty -> Cache_lifetime;
$ Smarty -> Caching = $ Config -> Smarty -> Caching;
Zend_registry::Set ('Smarty', $ Smarty);
}
Smarty is now integrated. Paste a little moreCodeRight
{
Function onclick ()
{
This. style. display = 'none'; document. getelementbyid ('Code _ closed_text_102554 '). style. display = 'none'; document. getelementbyid ('Code _ open_image_102554 '). style. display = 'inline'; document. getelementbyid ('Code _ open_text_102554 '). style. display = 'inline ';
}
} "Id =" code_closed_image_102554 "style =" display: none "> {
Function onclick ()
{
This. style. display = 'none'; document. getelementbyid ('Code _ open_text_102554 '). style. display = 'none'; getelementbyid ('Code _ closed_image_102554 '). style. display = 'inline'; getelementbyid ('Code _ closed_text_102554 '). style. display = 'inline ';
}
} "Id =" code_open_image_102554 "> Code
$ This -> Smarty = Zend_registry :: Get ( ' Smarty ' );
$ This -> Smarty -> Assign ( ' Bloguser ' , $ This -> Bloguser );
$ This -> Smarty -> Display ( $ Template );
There is an integrated method on the Internet that regards smarty as a plug-in of Zend framework. I think it is very troublesome. I am too lazy and still like to use it like this.