2007
12.29

  通常,使用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会带来很多思路上的束缚 :)

16 comments so far

Add Your Comment
  1. tomi on March 11, 2008 at 2:00 pm  

    (Quote)
    said:

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

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

  2. 代码罐头 on March 11, 2008 at 7:49 pm  

    (Quote)
    said:

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

    哈哈,已经加上。

*
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.
Click to hear an audio file of the anti-spam word