How would you handle extensions/plugins within Zend Framework?
For one of my client I need to develop a CMS. For instance, I need to have the following features:
- Skinnable (layout and extensions)
- Able to upload zip archives and process them (they contain pictures)
- Classic pages (articles ala wordpress, joomla)
- Contact form
- A catalog
- A cart
I'm used to Zend Framework so I'd like to develop it using Zf.
I'd like to have a very modular application, and I hope that my experience in playing around with Modx, Wordpress, Joomla, Magento will help me to avoid bad design.
I'd like to have a minimalist core system which on I could plug extensions/plugins and be able to customize them using defined conventions.
For example, I'd like that even one of my "core" features will be one of开发者_StackOverflow中文版 these extensions.
My feature could have:
- An admin interface
- A custom/default skin/themes
- Models
- Any needed fixtures
- A configuration files (xml/ini)
- Controllers
- Views
So my question is how would you handle such design? Is it good?
I'm wondering on how I'll register an extension to my app, how will I use it inside my layouts, controllers.
Well I don't really know how to start as the design will define all the development of my application.
I already decided to use ZF 1.1/2, Doctrine 2, jQuery/Dojo (don't know yet I don't really know Dojo)
Unfortunately, I cannot address all your questions. However, if you don't know where to start, I would recommend having a look (if possible) at Pro Zend Framework Techniques: Build a Full CMS Project. The book is not perfect, it does not cover plugins or extensions, but it gave me some information and a basic idea of how to build a CMS using ZF. One of the more interesting things that I learned from this book was using Node pattern as your data structure for CMS and how to use it in ZF as well as how to make layout skins. Additionally, you could have a look at the code of existing ZF's CMS systems such as TomatoCMS and Magento.
精彩评论