变态有趣的Zend Framework用法

  通常,使用ZF的人都对Controller很感兴趣,尤其是Rewrite和Router功能很吸引人,不过因为一些特殊原因,比如大项目中涉及大量的rewirte条件,导致全部交给php来处理有些难以接受,这个时候就可能会放弃掉ZF的Index.php文件, 而采用传统的PHP文件结构,这时的ZF如何使用呢?

  前一段时间完成的6.cn 的专辑改造 (http://6.cn/zj),完全基于了ZF来实现,但却没有使用ZF的index.php文件,在目录结构上,完全参照了ZF标准的Models、Views、Controllers模式开发,只不过调用的地方直接调用Controller里面的Action,这相当于把Controller当作了一个普通的类来使用,这个方法经过使用,发现虽然有些变态,其实还是挺有趣和挺方便的。有兴趣的朋友可以尝试一下,感觉似乎更灵活,有时index.php会带来很多思路上的束缚 🙂

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.
17 Responses
  1. fenglan says:

    挺好,灵活应用满足要求才是学习的最终目的。

  2. huzhangyou says:

    也一直使用ZF开发,感觉很顺手,虽然喜欢Borland的产品,但是Delphi For PHP目前的确不怎么地。

  3. MyZ says:

    直接使用controller
    想看看代码

  4. 某人 says:

    ZendFrameWork 耦合性够松散了,但是还是不够。

  5. tomi says:

    lz,多向你学习,希望也多关注我的blog哦有空加个链接:)
    http://www.80island.com

  6. Michael says:

    [Comment ID #25498 Will Be Quoted Here]

    已经加上,欢迎交流。
    刚点过去您的blog,第一篇文章是从我这里转的吗? 哈哈,是不是该feedback一下?

  7. 代码罐头 says:

    lz多向你学习,希望也多关注我的blog哦有空加个链接:d
    http://www.hiadmin.com

    此人很懒,只换了链接地址.

  8. Michael says:

    [Comment ID #25510 Will Be Quoted Here]

    哈哈,已经加上。

  9. leon says:

    6.cn现感觉很慢,点击后3秒才响应

  10. leon says:

    6.cn现感觉很慢,点击后3秒才响应。
    框架给开发上带来一定便利,同时也损失了一部分性能

  11. nevst says:

    是啊,我也得向你学习.

  12. Michael says:

    [Comment ID #25855 Will Be Quoted Here]

    6.cn主站没有用到ZF框架, ZF框架仅用到部分子站和独立的项目上了。

    最近慢是因为CDN在做较大的改造,改造完了就不会这样了。

  13. lyhiving says:

    跟我的做法一样,我是参照zfw跟thinkphp的做法,

    不过也是将controller做成class来用,觉得这样子很爽

    做了56的群组

    http://qun.56.com

  14. Michael says:

    [Comment ID #26223 Will Be Quoted Here]

    兄弟做的qun.56.com感觉不错啊,多多交流。

  15. 代码罐头 says:

    是啊.都留个blog地址
    要去学习

  16. tomi says:

    呵呵,最近人越来越懒了,懒得写了哈哈,ok feedback完了!!!:)

  17. Scarecrow says:

    现在的6.cn/zj 还是用的ZF么?

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