Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class UserController extends Zend_Controller_Action
- {
- public function init()
- {
- /* Initialize action controller here */
- }
- public function indexAction()
- {
- // action body
- }
- public function frankAction()
- {
- // action body
- }
- private function viewAction($var = null) {// renders via the /views/scripts/user/user.phtml template
- $var = $var? $var: 'user';
- $this->render($var);
- }
- public function __call($method,$args) {
- // $method is the method name (whose name contains 'Action')
- $username=ucwords(substr($method,0, -6)); // so we remove 'Action' from the end
- $this->view->username=$username;
- $this->countformfieldsAction();
- $this->viewAction();
- }
- public function newuserAction() {// renders application/views/scripts/user/user.phtml
- $payload = $this->getRequest()->getPost();
- $this->view->username = $payload['newuser'];
- $this->viewAction();
- }
- public function countformfieldsAction(){
- // action body
- $formfieldCounter = $this->_helper->getHelper('FormfieldCounter');
- $count = $formfieldCounter->count( $this->view->render('users/new-user.phtml'));
- //$this->view->count = $count;
- $this->view->count = 5; // for testting ##
- }
- public function newuserdataAction() {// renders application/views/scripts/user/user.phtml
- $payload = $this->getRequest()->getPost();
- $this->view->username = $payload['newuser'];
- $this->viewAction();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement