当前位置: 首页>>代码示例>>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;未经允许,请勿转载。