public function actionLogout() { $redirect = '/'; if (isset($_GET['redirect'])) { $redirect = $_GET['redirect']; } $this->logout(); Notif::info(static::MSG_LOGOUT_VALID); \Staq\Util::httpRedirectUri($redirect); }
protected function genericActionEdit($type, $model) { if (isset($_POST['model'])) { foreach ($_POST['model'] as $name => $value) { $model->set($name, $value); } $this->saveHandler($model); if ($model->save()) { Notif::success('Model saved.'); } else { Notif::error('Model not saved.'); } $this->redirectPreview($type, $model); } $view = $this->createView('edit', $type); $view['model'] = $model; return $view; }
protected function addVariables() { $this['UINotification'] = \Stack\Util\UINotification::pull(); }