Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class UsersController extends Zend_Controller_Action
- {
- public function init()
- {
- /* Initialize action controller here */
- }
- public function indexAction()
- {
- $this->view->username = 'Jeremy';
- $this->_viewAction();
- }
- public function listAction()
- {
- $this->view->userList = array('Jeremy', 'Scott', 'Edin', 'Gareth');
- }
- public function __call($method, $args)
- {
- $username = ucwords(substr($method, 0, -6));
- $this->view->username = $username;
- $this->_viewAction();
- }
- protected function _viewAction()
- {
- $this->render('user');
- }
- }
- //view
- <?php if (!empty($this->userList)): ?>
- <div><?php echo $this->htmlList($this->userList) ; ?></div>
- <?php else: ?>
- <div>No users available</div>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement