解决了ZF的两个问题

  之前提到Zend Framework的三个问题,有两个问题今天晚上搞明白了。

  • ErrorController官方文档里面提到的_getRequest(‘error_handler’)方法不存在的问题,改成 $this->_getParam(‘error_handler’)即可解决。
  • Controller里面的init()方法会在基类的构造函数__construct()之前调用的问题,通过阅读 Zend_Controller_Action类里面的100-130行找到解决办法,就是在基类的__construct()里面,把 parent::__construct($request, $response, $invokeArgs); 移到初始化操作之后,比如__construct()的最后一行即可解决。

  第三个关于 useDefaultControllerAlways 参数导致_forward()方法的controller参数失效的问题不是太紧急,回头再研究。

  顺便提一下,ZF的Router功能实在太强大了,甚至支持正则匹配,完全可以写出任何你想要的灵活的URL来,赞!

Category: PHP / Zend  Tags: , ,
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
No Responses
  1. 먹튀 says:

    You’ve made some good points there. I checked on the web for more
    information about the issue and found most people will go along with your views on this web site.

  2. Simply desire to say your article is as surprising.
    The clarity on your post is just nice and i could assume you’re a professional on this subject.
    Well along with your permission let me to grab your RSS feed to
    keep updated with imminent post. Thank you a million and please keep up the gratifying
    work.

  3. Hey just wanted to give you a quick heads up. The words
    in your article seem to be running off the screen in Chrome.
    I’m not sure if this is a formatting issue or something to do with web browser compatibility but I figured I’d
    post to let you know. The layout look great though! Hope you get the issue solved soon. Thanks

  4. What’s up, its good post concerning media print, we all be aware of media is
    a enormous source of facts.

  5. ps4 games says:

    I’m gone to convey my little brother, that he should also go to see this webpage on regular basis to obtain updated from latest information.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image