本文整理汇总了PHP中Flash::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::get方法的具体用法?PHP Flash::get怎么用?PHP Flash::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flash
的用法示例。
在下文中一共展示了Flash::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _redirect
private function _redirect($do = false)
{
$redirect = "";
if (empty($do)) {
if (!empty(Flash::get("redirect"))) {
$redirect = Flash::get("redirect");
} else {
if (!empty(Flash::get("HTTP_REFERER"))) {
$redirect = Flash::get("HTTP_REFERER");
}
}
$redirect = $this->_sanitizeRedirect($redirect);
}
if ($do === true || is_string($do)) {
if (is_string($do)) {
$redirect = $this->_sanitizeRedirect($do);
}
if (empty($redirect)) {
$redirect = get_url();
}
redirect($redirect);
die;
}
return $redirect;
}
示例2: add
public function add($parent_id = 1)
{
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_add();
}
$data = Flash::get('post_data');
$page = new Page($data);
$page->parent_id = $parent_id;
$page->status_id = Setting::get('default_status_id');
$page_parts = Flash::get('post_parts_data');
if (empty($page_parts)) {
// check if we have a big sister ...
$big_sister = Page::findBigSister($parent_id);
if ($big_sister) {
// get all is part and create the same for the new little sister
$big_sister_parts = Record::findAllFrom('PagePart', 'page_id=? ORDER BY id', array($big_sister->id));
$page_parts = array();
foreach ($big_sister_parts as $parts) {
$page_parts[] = new PagePart(array('name' => $parts->name, 'filter_id' => Setting::get('default_filter_id')));
}
} else {
$page_parts = array(new PagePart(array('filter_id' => Setting::get('default_filter_id'))));
}
}
// display things ...
$this->setLayout('backend');
$this->display('page/edit', array('action' => 'add', 'page' => $page, 'tags' => array(), 'filters' => Filter::findAll(), 'behaviors' => Behavior::findAll(), 'page_parts' => $page_parts, 'layouts' => Layout::find()));
}
示例3: forgot
function forgot()
{
if (get_request_method() == 'POST') {
return $this->_sendPasswordTo($_POST['forgot']['email']);
}
$this->display('login/forgot', array('email' => Flash::get('email')));
}
示例4: add
/**
* Action to add a page.
*
* @param int $parent_id The page id for the new page's parent. Defaults to page 1.
* @return <type>
*/
public function add($parent_id = 1)
{
// Check if trying to save.
if (get_request_method() == 'POST') {
return $this->_store('add');
}
// If not trying to save, display "Add page" view.
$data = Flash::get('post_data');
$page = new Page($data);
$page->parent_id = $parent_id;
$page->status_id = Setting::get('default_status_id');
$page->needs_login = Page::LOGIN_INHERIT;
$page_parts = Flash::get('post_parts_data');
if (empty($page_parts)) {
// Check if we have a big sister.
$big_sister = Record::findOneFrom('Page', 'parent_id=? ORDER BY id DESC', array($parent_id));
if ($big_sister) {
// Get list of parts create the same for the new little sister
$big_sister_parts = Record::findAllFrom('PagePart', 'page_id=? ORDER BY id', array($big_sister->id));
$page_parts = array();
foreach ($big_sister_parts as $parts) {
$page_parts[] = new PagePart(array('name' => $parts->name, 'filter_id' => Setting::get('default_filter_id')));
}
} else {
$page_parts = array(new PagePart(array('filter_id' => Setting::get('default_filter_id'))));
}
}
// Display actual view.
$this->setLayout('backend');
$this->display('page/edit', array('action' => 'add', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'page/add'), 'page' => $page, 'tags' => array(), 'filters' => Filter::findAll(), 'behaviors' => Behavior::findAll(), 'page_parts' => $page_parts, 'layouts' => Record::findAllFrom('Layout')));
}
示例5: action_logout
/**
*
*/
public function action_logout()
{
$this->auto_render = false;
Auth::instance()->logout();
if ($next_url = Flash::get('redirect')) {
$this->go($next_url);
}
$this->go_home();
}
示例6: action_logout
public function action_logout()
{
$this->auto_render = FALSE;
Auth::instance()->logout(TRUE);
Observer::notify('admin_after_logout', Auth::get_username());
if ($next_url = Flash::get('redirect')) {
$this->go($next_url);
}
$this->go_home();
}
示例7: action_add
public function action_add()
{
$data = Flash::get('roles::add::data', array());
$role = ORM::factory('role')->values($data);
if (Request::current()->method() == Request::POST) {
return $this->_add($role);
}
$this->set_title(__('Add role'));
$this->template->content = View::factory('roles/edit', array('action' => 'add', 'role' => $role));
}
示例8: action_add
public function action_add()
{
$data = Flash::get('post_data', array());
$job = ORM::factory('job')->values($data);
// check if trying to save
if (Request::current()->method() == Request::POST) {
return $this->_add($job);
}
$this->set_title(__('Add job'));
$this->template->content = View::factory('jobs/edit', array('action' => 'add', 'job' => $job));
}
示例9: action_add
public function action_add()
{
$data = Flash::get('users::add::data', array());
$user = ORM::factory('user')->values($data);
// check if trying to save
if (Request::current()->method() == Request::POST) {
return $this->_add($user);
}
$this->set_title(__('Add user'));
$this->template->content = View::factory('users/edit', array('action' => 'add', 'user' => $user, 'permissions' => array()));
}
示例10: action_add
public function action_add()
{
// check if user have already enter something
$data = Flash::get('post_data', array());
$type = ORM::factory('email_type');
// check if trying to save
if (Request::current()->method() == Request::POST) {
return $this->_add($type);
}
$this->set_title(__('Add email type'));
$this->template->content = View::factory('email/types/edit', array('action' => 'add', 'type' => $type, 'templates' => $type->templates->find_all()));
}
示例11: add
public function add()
{
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_add();
}
// check if user have already enter something
$tag = Flash::get('post_data');
if (empty($tag)) {
$tag = new Tagger();
}
$this->display('tagger/views/edit', array('action' => 'add', 'tag' => $tag));
}
示例12: add
function add()
{
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_add();
}
// check if user have already enter something
$layout = Flash::get('post_data');
if (empty($layout)) {
$layout = new Layout();
}
$this->display('layout/edit', array('action' => 'add', 'layout' => $layout));
}
示例13: add
function add()
{
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_add();
}
// check if user have already enter something
$snippet = Flash::get('post_data');
if (empty($snippet)) {
$snippet = new Snippet();
}
$this->display('snippet/edit', array('action' => 'add', 'filters' => Filter::findAll(), 'snippet' => $snippet));
}
示例14: add
public function add()
{
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_add();
}
// check if user have already enter something
$data = Flash::get('post_data');
$testimonial = null;
if (isset($data)) {
$testimonial = new Testimonial($data);
}
$this->display('testimonial/edit', array('action' => 'add', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'testimonial/add'), 'testimonial' => $testimonial, 'pages' => Record::findAllFrom('Page', 'parent_id=1 order by parent_id,position')));
}
示例15: action_add
public function action_add()
{
// check if trying to save
if (Request::current()->method() == Request::POST) {
return $this->_add();
}
Assets::package('ace');
$this->set_title(__('Add layout'));
// check if user have already enter something
$layout = Flash::get('post_data');
if (empty($layout)) {
$layout = new Model_File_Layout();
}
$this->template->content = View::factory('layout/edit', array('action' => 'add', 'layout' => $layout));
}