Zend Framework Action: URL Structure and ActionTag: framework, zend, zend framework, actions, url structure, controller Category: PHP Frameworkpost: 11 Apr 2008 read: 1,666 Zend Framework Action Step By Step Tutorial - Part 3: Just remember, we have rule like this: http://hostname/controller/action/parametes. We have talked about controller. Now, we discuss next part, action. For simply, action is method in our class at controller. Look at our code:
Above, we have action name "index". Naming in Zend Framework, add with Action. Thus, we have action "indexAction". When we call this controller (such as user), but we don't specify action, it will call indexAction as default. Now, add a method in there, example "nameAction" such as:
Below, complete our userController:
Next, create a file named "name.phtml" within views/scrips/user. Enter following code:
Now, point your browser to http://localhost/test/zend/helloworld/web_root/user/name
| ||
| | Give Your Opinion | Recommend |
|

