當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Flash::clear方法代碼示例

本文整理匯總了PHP中Flash::clear方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flash::clear方法的具體用法?PHP Flash::clear怎麽用?PHP Flash::clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Flash的用法示例。


在下文中一共展示了Flash::clear方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _add

 private function _add(ORM $page)
 {
     $page_data = $this->request->post('page');
     // Сохраняем полученые данные в сесиию
     Flash::set('page::add::data', $page_data);
     // Создаем новую страницу
     try {
         $page = $page->values($page_data)->create();
         // Если есть права на управление ролями
         if (ACL::check('page.permissions')) {
             $page->save_permissions($this->request->post('page_permissions'));
         }
         Messages::success(__('Page has been saved!'));
         Flash::clear('page::add::data');
     } catch (ORM_Validation_Exception $e) {
         Messages::errors($e->errors('validation'));
         $this->go_back();
     } catch (Kohana_Exception $e) {
         Messages::errors(__('Something went wrong!'));
         $this->go_back();
     }
     // save and quit or save and continue editing ?
     if ($this->request->post('commit') !== NULL) {
         $this->go();
     } else {
         $this->go(array('action' => 'edit', 'id' => $page->id));
     }
 }
開發者ID:ZerGabriel,項目名稱:cms-1,代碼行數:28,代碼來源:page.php

示例2: _edit

 private function _edit($job)
 {
     $data = $this->request->post();
     $this->auto_render = FALSE;
     $job->values($data);
     try {
         if ($job->update()) {
             Kohana::$log->add(Log::INFO, 'Job :job has been updated by :user', array(':job' => HTML::anchor(Route::get('backend')->uri(array('controller' => 'scheduler', 'action' => 'edit', 'id' => $job->id)), $job->name)))->write();
             Flash::clear('post_data');
             Messages::success(__('Job has been saved!'));
         }
     } catch (ORM_Validation_Exception $e) {
         Messages::errors($e->errors('validation'));
         $this->go_back();
     }
     // save and quit or save and continue editing?
     if ($this->request->post('commit') !== NULL) {
         $this->go(Route::get('backend')->uri(array('controller' => 'jobs')));
     } else {
         $this->go(Route::get('backend')->uri(array('controller' => 'jobs', 'action' => 'edit', 'id' => $job->id)));
     }
 }
開發者ID:ZerGabriel,項目名稱:cms-1,代碼行數:22,代碼來源:jobs.php

示例3: SSP_Slideshow

        //CREATE PAGE PART
        $slideshow = '<?php echo new SSP_Slideshow(' . $ssid . ');?>';
        $sql = "INSERT INTO wolfpage_part (name, filter_id, content, content_html, page_id) VALUES ('ssp_slideshow', null, '" . $slideshow . "', '" . $slideshow . "', " . $pageId . ");";
        $query = Record::query($sql);
        if ($query) {
            $status_message = 'Successfully created Slideshow';
            $status_type = 'success';
            Flash::set('page', $pageId);
        } else {
            $status_message = 'Could not create Slideshow';
            $status_type = 'errors';
        }
        break;
    case 'delete':
        $sql = "DELETE FROM wolf_ssp WHERE page_id=" . $pageId . "; DELETE FROM wolf_page_part WHERE name='ssp_slideshow' AND page_id=" . $pageId . ";";
        $query = Record::query($sql);
        if ($query) {
            $status_message = 'Successfully deleted Slideshow';
            $status_type = 'success';
            Flash::clear();
        } else {
            $status_message = 'Could not delete Slideshow';
            $status_type = 'errors';
        }
        break;
    default:
        break;
}
//COMPLETE. REDIRECT
Flash::set($status_type, $status_message);
header('Location:' . URL_PUBLIC . 'admin/plugin/ssp/manage');
開發者ID:ariksavage,項目名稱:superior-optical-eyewear,代碼行數:31,代碼來源:save_ss.php


注:本文中的Flash::clear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。