当前位置: 首页>>代码示例>>PHP>>正文


PHP Hook::instance方法代码示例

本文整理汇总了PHP中Hook::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Hook::instance方法的具体用法?PHP Hook::instance怎么用?PHP Hook::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hook的用法示例。


在下文中一共展示了Hook::instance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

 public static function instance()
 {
     if (self::$instance === NULL) {
         self::$instance = new Hook();
     }
     return self::$instance;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:7,代码来源:hook.php

示例2: singleton

 public static function singleton()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
开发者ID:kvirella,项目名称:magrocket-backend,代码行数:8,代码来源:Hook.php

示例3: action_sendreminder

 public function action_sendreminder()
 {
     $date = strtotime(date('d-m-Y'));
     $reminder = ORM::factory('reminder');
     $reminder->where('reminders.date', '=', $date);
     $reminder = $reminder->find();
     if ($reminder->id) {
         echo "reminder already sent";
         exit;
     } else {
         $reminder->date = $date;
         $reminder->save();
         Hook::instance()->trigger("send_reminder");
     }
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:15,代码来源:cron.php

示例4: 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'));
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:9,代码来源:init.php

示例5: action_summary

 public function action_summary()
 {
     $id = $this->request->param('id');
     if (!$id) {
         Request::current()->redirect('course');
     }
     Session::instance()->set('course_id', $id);
     $course = ORM::factory('course', $id);
     // Todo
     $count_student = Model_Course::get_users_count($id, 'student');
     $results = Hook::instance()->trigger("course_count", $course);
     //$count_exam = Model_Exam::get_course_exams_count($id);
     $count = array('count_student' => $count_student, 'results' => $results);
     $feeds = Request::factory('feed/feeds/id/' . $id)->method(Request::GET)->execute()->body();
     $data = array();
     $data['course_id'] = $id;
     $total_feeds = Model_Feed::get_total_feeds($data);
     $view = View::factory('course/summary')->bind('course', $course)->bind('feeds', $feeds)->bind('total_feeds', $total_feeds)->bind('count', $count);
     Breadcrumbs::add(array('Courses', Url::site('course')));
     Breadcrumbs::add(array($course->name, Url::site('course/summary/id/' . $id)));
     $this->content = $view;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:22,代码来源:course.php


注:本文中的Hook::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。