Advertisement
mOrloff

UserController.php

Jun 14th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. class UserController extends Zend_Controller_Action
  2. {
  3.  
  4.     public function init()
  5.     {
  6.         /* Initialize action controller here */
  7.     }
  8.  
  9.     public function indexAction()
  10.     {
  11.         // action body
  12.     }
  13.  
  14.     public function frankAction()
  15.     {
  16.         // action body
  17.     }
  18.  
  19.     public function __call($method,$args) {
  20.         // $method is the method name which contains 'Action'
  21.         $username=ucwords(substr($method,0, -6));  // so we remove 'Action' from the end
  22.         $this->view->username=$username;
  23.         $this->render('user');  // renders application/views/scripts/user/user.phtml
  24.     }
  25.  
  26. /*    public function viewAction() {// renders application/views/scripts/user/user.phtml
  27.         $this->render('user');        
  28.     }*/  // moved the contents of this method to the _call method, so is this needed ???
  29.  
  30.     public function newuserAction() {// renders application/views/scripts/user/user.phtml
  31.         $payload = $this->getRequest()->getPoset();
  32.         $this->view->username = $payload['data'];
  33.         $this->render('user');        
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement