开发者

How should I extend the Zend Framework as a folder organisation point of view?

I am currently integrating the Zend Framework in my current project named VMM. I decided to put the Zend Framework directory as a standalone project next to my VMM project in Eclipse. I need to do some customization of the zend framework (For example I need to add Irradiance.php into Measure) and I would like to know where is the best place to put all my customizations.

I know that I need to follow the Zend Framework naming convention and the same directory structure. So for example Irradiance.php contain the Mylib_Measure_Irradiance class.

I was thinking to put the Mylib folder into ZendFr开发者_如何学Camework/library/Mylib next to the Zend folder.

Is it the regular way to extend and customize the Zend Framework? If not, should I put the customizations inside my VMM project or as an other standalone project?

Thanks!


UPDATE

This question helped me but I still need some help...


I tend not to put my own library style files into the ZF folder mainly because when you come to upgrade ZF you'll have to copy them all over to the new ZF.

On my localhost I have something like this

my-project is the project I am working on and contains all the models, views, controllers,etc for that project

/htdocs/my-project/application
/htdocs/my-project/public

library is my own library files and mimics the ZF structure

/htdocs/library/Db/
/htdocs/library/Validate/

I then have my current ZF in /usr/lib/php/ZendFramework-x.xx.x this folder contains the latest ZF and can be changed easily without changing my projects or library code base.

Edit:

David's comments about 'pointers' reminded me, I always set up a sym link in /usr/lib/php/ called ZendLatest, this points to the latest copy of ZF, this means I don't have to keep changing my code or my php.ini.


There are many ressources out there:

  • http://www.slideshare.net/PHPBelgium/extending-zend-framework-presentation
  • http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜