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.