examples/retwitter/application/controllers/UserController.php
public function signupAction()
    {
        $form = new Form_User;
        
        if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
            
            $userData = $form->getValues();
            $userData['id'] = User::fetchNextId();
            
            // save user
            $user = new User($userData['id']);
            $user->setValue($userData);
            
            $users = new Users();
            $users->add($userData['id']);
            
            // save login to id link
            User::setLoginToIdLink($userData['login'], $userData['id']);
            
            $this->_redirect('/user/login');
        }
        
        $this->view->form = $form;
    }
public function signupAction()
    {
        $form = new Form_User;
        
        if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
            
            $userData = $form->getValues();
            $userData['id'] = User::fetchNextId();
            
            // save user
            $user = new User($userData['id']);
            $user->setValue($userData);
            
            $users = new Users();
            $users->add($userData['id']);
            
            // save login to id link
            User::setLoginToIdLink($userData['login'], $userData['id']);
            
            $this->_redirect('/user/login');
        }
        
        $this->view->form = $form;
    }
Signup