本文整理汇总了PHP中Notice::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Notice::instance方法的具体用法?PHP Notice::instance怎么用?PHP Notice::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notice
的用法示例。
在下文中一共展示了Notice::instance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_preferences
public function action_preferences()
{
$view = View::factory('notice/preferences')->bind('notices', $notices)->bind('pref_email', $pref_email)->bind('pref_sms', $pref_sms)->bind('menu', $menu)->bind('success', $success);
if ($this->request->method() === 'POST' && $this->request->post()) {
if ($this->request->post('pref')) {
$noticesetting = ORM::factory('noticesetting')->where('institution_id', ' = ', 1)->find();
$noticesetting->preferences = serialize($this->request->post('pref'));
$noticesetting->save();
Session::instance()->set('success', 'Notice preferences modified successfully');
Request::current()->redirect('notice/preferences');
}
}
$notices = Kohana::config('notices')->as_array();
$pref_email = Notice::instance()->preferences('email');
$pref_sms = Notice::instance()->preferences('sms');
$menu = $this->menu('preferences');
$success = Session::instance()->get_once('success');
$this->content = $view;
}
示例2: defined
<?php
defined('SYSPATH') or die('No direct script access.');
DynamicMenu::extend(array('sidemenu' => array(array('exam', 'Exam', 5, array()))));
// register handler class for sending exam related notices upon various events
Notice::instance()->register_handler('exam');
Hook::instance()->register("send_reminder", 'Model_Exam::send_exam_reminder');
Hook::instance()->register("course_count", 'Model_Exam::get_course_exams_count');
Route::set('exam', '(<controller>(/<action>(/<params>)))', array('params' => '.*?'))->defaults(array('controller' => 'exam', 'action' => 'index'));