Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UserController extends Zend_Controller_Action
- {
- public function init()
- {
- /* Initialize action controller here */
- }
- public function indexAction()
- {
- // action body
- }
- public function frankAction()
- {
- // action body
- }
- public function __call($method,$args) {
- // $method is the method name which contains 'Action'
- $username=ucwords(substr($method,0, -6)); // so we remove 'Action' from the end
- $this->view->username=$username;
- $this->render('user'); // renders application/views/scripts/user/user.phtml
- }
- /* public function viewAction() {// renders application/views/scripts/user/user.phtml
- $this->render('user');
- }*/ // moved the contents of this method to the _call method, so is this needed ???
- public function newuserAction() {// renders application/views/scripts/user/user.phtml
- $payload = $this->getRequest()->getPoset();
- $this->view->username = $payload['data'];
- $this->render('user');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement