sign up g
Figure 3-4. Mapping URL to controller action
The second component in the URL figure is the account portion, which is the controller of the application. In this example, the account section in the URL is mapped to the AccountController.php file. If you want to create a controller to control all actions for members in the site, you might create a MemberController; this controller would then handle requests where the URL is http://www.loudbite.com/member/. In the case of the ArtistController, the URL to load the controller is http://www.loudbite.com/artist/.
The third and final section in the URL is the action you want to take within the controller. In Figure 3-4, the action is the successAction() method within the AccountController.
Taking this example and using it on another URL pattern, http://www.loudbite.com/member/viewall, the URL will route the user to the MemberController and then route the user to the MemberController viewallAction() method. That wasn't so hard, was it? Now go ahead and start creating a few actions on your own with Zend Tool before you jump into the advanced routing setup.
Was this article helpful?