Today we talk about the use of php mvc template zend and configuration examples, which is a load from the zend file to load the database getinstance () method used to obtain the front-end control Instance load smarty template plug-ins and other simple configuration method. * / // specify the path to the reference file set_include_path ('.'. path_separator. './libary/'. / / specify the directory where zend path_separator. './application/models/'. // Specify the directory where the model is located path_separator. './libary/smarty/'. path_separator. get_include_path ());
// You must manually load loader.php include "zend / loader.php"; zend_loader :: registerautoload ();
// Load the database configuration file //zend/config/ini.php $ config = new zend_config_ini ('./application/config.ini', 'general'); $ registry = zend_registry :: getinstance (); $ registry-> set ('config', $ config);
// $ db = zend_db :: factory ($ config-> db); $ db-> query ('set names gbk'); zend_db_table :: setdefaultadapter ($ db); The // getinstance () method is used to get the front controller instance $ frontcontroller = zend_controller_front :: getinstance (); // specify the module directory $ frontcontroller-> addmoduledirectory ('./application'); // Load smarty template plugin $ frontcontroller-> registerplugin (new plugin_myplugin ());
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.