Several Problems in Zend framework Configuration

Source: Internet
Author: User

Zend framework Configuration

I.
If you have used the. htaccess file and enabled rewriteengine, you need to do two things in httpd. conf on the Apache server:

1. Enable mod_rewrite.so ------- approximately in the HTTP. conf 106 line, remove
"#" Before loadmodule rewrite_module modules/mod_rewrite.so "#".

2. To make the configuration in. htaccess take effect, you must set AllowOverride all ------- to be around 200 rows. The default value is none.

II.

If you want to use zend_view-> render in the Action Method of the controller class to call the View Script, you must turn off the view rendering viewrenderer, because zendframe is enabled by default (in this way, the Controller class will find view/scripts/XXX/YYY by default. phtml ------ XXX your widget xxxcontroller, YYY your action yyyaction). Only by disabling viewrenderer can you manually control the view rendering.
If you do not disable viewrenderer, the Controller first uses viewrenderer to parse views/scripts/XXX/yyy. phtml, and then parse the script specified by zend_view: render (). This parses the two scripts, which is interesting.
If you do not disable viewrenderer and you have set the correct zend_view: setscriptpath () path, then your yyy. the scripts specified by phtml and render () must exist at the same time. If one script is missing, it cannot be parsed.

Close method:
Global shutdown: Use the zend_controller_front instance and close it before zend_controller_front-> dispatch (): $ front-> setparam ('noviewrenderer', true );
Close only for a specific action. In xxxcontroller-> yyyaction (): $ this-> _ helper-> viewrender-> setnorender ().
It is best to disable viewrender only for an action.

<? PHP
Require_once 'zend/controller/front. php ';
 
$ Front = zend_controller_front: getinstance ();
$ Front-> setcontrollerdirectory (Array (
'Default' => '/path/to/controllers ',
...
));
// You can also use $ front-> addmoduledirectory ('/path/to/application/Les') without specifying each 'module '=> 'path'
$ Front-> setparam ('noviewrenderer', true );
$ Front-> dispatch ();
?>

3.
zend_controller_front-> setcontrollerdirectory ('... ') and
zend_view-> setscriptpath ('... ')
both paths are for the web root directory index. the PHP file is a relative path.

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.