本文整理汇总了PHP中Application_Model_User::addUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_User::addUser方法的具体用法?PHP Application_Model_User::addUser怎么用?PHP Application_Model_User::addUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_User
的用法示例。
在下文中一共展示了Application_Model_User::addUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
public function addAction()
{
if ($this->_request->isPost()) {
$user_data = $this->_request->getParams();
$user = new Application_Model_User();
$user->addUser($user_data);
//$this->view->user_data=$user_data;
//$this->render();
}
}
示例2: addAction
public function addAction()
{
$form = new Application_Form_User();
if ($this->_request->isPost()) {
if ($form->isValid($this->_request->getParams())) {
$user_info = $form->getValues();
$user_model = new Application_Model_User();
$user_model->addUser($user_info);
}
if (Zend_Auth::getInstance()->getStorage()->read()->type == "admin") {
$this->redirect("user/list");
} else {
$this->redirect("user/login");
}
}
$this->view->form = $form;
}
示例3: registerAction
public function registerAction()
{
// action body
$this->view->page_title = "Registration Form";
$user_form = new Application_Form_Register();
if ($this->getRequest()->isPost()) {
if ($user_form->isValid($_POST)) {
$user_model = new Application_Model_User();
$this->view->success = $user_model->addUser($user_form->getValues());
$auth = Zend_Auth::getInstance();
$namespace = new Zend_Session_Namespace();
$namespace->username = $user_form->getValue('username');
$namespace->password = $user_form->getValue('password');
$namespace->id = $user_model->getID($namespace->username);
$this->view->username = $namespace->username;
$this->_redirect('/users/index');
}
}
$this->view->form = $user_form;
}