本文整理匯總了PHP中TabController::getVariableTabs方法的典型用法代碼示例。如果您正苦於以下問題:PHP TabController::getVariableTabs方法的具體用法?PHP TabController::getVariableTabs怎麽用?PHP TabController::getVariableTabs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TabController
的用法示例。
在下文中一共展示了TabController::getVariableTabs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: RemindPasswordAction
function RemindPasswordAction()
{
$varTabs = array();
$request = Project::getRequest();
$this->_view->clearFlashMessages();
if ($request->remind) {
$userModel = new UserModel();
$noErrors = true;
$email = trim($request->email);
if (!$email) {
$this->_view->addFlashMessage(FM::ERROR, "Введите Email");
$noErrors = false;
} else {
$userModel->loadByEmail($email);
if (!$userModel->id) {
$this->_view->addFlashMessage(FM::ERROR, "Такой Email не регистрировался");
$noErrors = false;
}
}
if ($noErrors) {
$newPass = rand(111111, 9999999);
$salt = AppCrypt::generateSalt();
$userModel->salt = $salt;
$userModel->pass = AppCrypt::getHash($newPass, $salt);
$userModel->save();
$mailer = new PHPMailer();
$mailer->CharSet = "utf-8";
$mailer->From = "info@next24.ru";
$mailer->FromName = "Next24.ru";
$mailer->Subject = "Восстановление пароля в системе Next24.ru ";
$body = "Восстановление пароля в системе Next24.ru: <br>Логин: " . $userModel->login . " <br>Новый пароль: " . $newPass;
$alt_body = "Восстановление пароля в системе Next24.ru: \nЛогин: " . $userModel->login . " \nНовый пароль: " . $newPass;
$mailer->Body = $body;
$mailer->AltBody = $alt_body;
$mailer->AddAddress($email, $userModel->first_name . " " . $userModel->middle_name . " " . $userModel->last_name);
$mailer->Send();
$this->_view->addFlashMessage(FM::INFO, "На указанный Email был выслан новый пароль");
}
}
$varTabs[] = array('name' => "Напоминание пароля", 'title' => "Напоминание пароля", 'selected' => true, 'controller_name' => "User", 'action_name' => "RemindPassword");
$this->_view->assign('tab_list', TabController::getVariableTabs($varTabs));
// Show tabs
$this->_view->RemindPassword();
$this->_view->parse();
}