开发者

Zend framework techniques

I am trying to migrate to zend framework. Should each webpage be a Controller or an action.

What is the advantag开发者_运维技巧e of having multiple actions. Can they talk to each other? and whats the best use of Action helpers and View helpers.

Please guide me on how to start on the framework.. thanks


You can use a new controller for each page or define multiple actions on the same controller to render your pages. I choose to use defferent action from the same controller to display variuos pages. Using multiple action on the same controller allows you to put some code in che constructor of the controller that is executed for each action. For example i have a controller for all the pulic pages of a website and a new controller for those pages that are reserved to registered users. In the constructor for the controller dedicated to registered user i do the check for authentication.


You should check that page about MVC applications, It's not precisely related to Zend. But you seems to be asking what a MVC Design Pattern is.


You got to create a controller for each of your site's pages. If any page interacts with db, you should also create model for that page. Also you should create view for each of your page.

If you have no idea about MVC, you can read this:

MVC


Those links are from Zend Framework manual.
Do not afraid and click - read the Introduction chapters - you will have all answers. ;-)

  • View helpers
  • Action helpers
  • Action Controllers


First get a sound understand of MVC Framework: Understanding MVC Architecture from its Origin (part I) http://learnnewprogramming.com/blog/understanding-mvc-architecture/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜