Please! Please! Please! Zend_framework solution

Source: Internet
Author: User
Please! Please! Please! Zend_framework Configuration tutorial .. Please send a Configuration tutorial, PHPcode & lt ;? Phperror_reporting (E_ALL | E_STRICT); // when the error report date_defaul is enabled, find it! Please! Please! Zend_framework
Find the Configuration tutorial of Zend_framework ..

Please send a Configuration tutorial that you have used

------ Solution --------------------
PHP code
  SetFallbackAutoloader (true); // automatically load class files in static mode $ registry = Zend_Registry: getInstance (); // Obtain instances in static mode $ view = new Zend_View (); // instantiate the zend template $ view-> setScriptPath ('. /application/views/web/'); // set the template display path $ registry ['View'] = $ view; // register view // configure database parameters, connect to the database $ config = new Zend_Config_Ini ('. /application/config. ini ', null, true); Zend_Registry: set ('config', $ config); $ dbAdapter = Zend_Db: factory ($ config-> general-> Db-> adapter, $ config-> general-> db-> config-> toArray (); $ dbAdapter-> query ('set NAMES utf8'); Zend_Db_Table :: setdefaadapter adapter ($ dbAdapter); Zend_Registry: set ('dbadapter ', $ dbAdapter); // Database end // set the controller $ frontController = Zend_Controller_Front: getInstance (); $ frontController-> setBaseUrl ('/mvc') // you can change the basic path mvc to the path of your project-> setParam ('noviewrenderer', true)-> setControllerDirectory ('. /application/controllers ')-> ThrowExceptions (true)-> dispatch ();?>

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.