本文整理汇总了PHP中Utility::setFlash方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::setFlash方法的具体用法?PHP Utility::setFlash怎么用?PHP Utility::setFlash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::setFlash方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDelete
public function actionDelete($id)
{
$page = $this->loadModel($id);
$page->delete();
Utility::setFlash('page deleted successfully.', 'success');
$this->redirect($this->createUrl('page/listing'));
}
示例2: actionDelete
public function actionDelete()
{
$id = Yii::app()->request->getParam('id');
$user = User::model()->findByPk($id);
$user->delete();
Utility::setFlash('User deleted successfully', 'success');
$this->redirect(Yii::app()->createUrl('/admin/user/list'));
}
示例3: run
public function run()
{
$formModel = new ChangePasswordForm();
if (isset($_POST['ChangePasswordForm'])) {
$formModel->attributes = $_POST['ChangePasswordForm'];
if ($formModel->validate()) {
$user = User::model()->findByPk(Yii::app()->user->getId());
$user->password = md5($formModel->password);
$user->save(false);
Utility::setFlash('Password changed successfully.', 'success');
}
}
$this->getController()->render('change_password', array('formModel' => $formModel));
}
示例4: actionDelete
public function actionDelete()
{
$id = Yii::app()->request->getParam('id');
$qr = $this->loadModel($id);
Log::model()->deleteAll('qr_id = :qr_id', array(':qr_id' => $id));
$qr->delete();
Utility::setFlash(Yii::t('dict', 'Deleted successfully.'), 'success');
$this->redirect(array('list'));
}
示例5: actionEmail_verify
public function actionEmail_verify()
{
$code = trim(Yii::app()->request->getQuery('code'));
if ($code) {
$user = User::model()->findByAttributes(array('auth_code' => $code));
if ($user) {
$user->is_active = 1;
$user->auth_code = md5(uniqid());
$user->save();
Utility::setFlash('Your email has been verified. Please login below.', 'success');
Yii::app()->request->redirect('login');
}
}
echo 'invalid code';
Yii::app()->end();
}