The UserController
class will contain several action methods providing an administrative
user interface for managing the registered users. It will have the following actions:
indexAction()
action will display a web page containing the list of users (see figure 16.3).
Type "http://localhost/users" in your web browser's navigation bar to access this page.addAction()
will display a page allowing the creation of a new user (see figure 16.4).
Type "http://localhost/users/add" in your web browser's navigation bar to access this page.editAction()
action will display a page for updating an existing user (see figure 16.5).
Type "http://localhost/users/edit/<id>" in your web browser's navigation bar to access this page.viewAction()
will allow viewing an existing user (see figure 16.6).
Type "http://localhost/users/view/<id>" in your web browser's navigation bar to access this page.changePasswordAction()
action will give the admin the ability to change the password of an existing user (see figure 16.7).
Type "http://localhost/users/changePassword/<id>" in your web browser's navigation bar to access this page.resetPasswordAction()
action will allow a user to reset his own password (see figure 16.8).
Type "http://localhost/reset-password" in your web browser's navigation bar to access this page.The UserController
controller class is designed to be as "thin" as possible. It contains only the code responsible for
checking input data, instantiating the needed models, passing input data to the models and returning the output data for
rendering in a view template. Because it is a typical controller class
and because you can see its complete code in the User Demo sample, we will not describe it here in more detail.