예제 #1
0
 /**
  * Initialize plguin
  */
 public function __construct(Alloy\Kernel $kernel)
 {
     $this->kernel = $kernel;
     // Let autoloader know where to find Spot library files
     $kernel->loader()->registerNamespace('Spot', __DIR__ . '/lib');
     // Make methods globally avaialble with Kernel
     $kernel->addMethod('mapper', array($this, 'mapper'));
     $kernel->addMethod('spotConfig', array($this, 'spotConfig'));
     $kernel->addMethod('spotForm', array($this, 'spotForm'));
     // Debug Spot queries
     $kernel->events()->bind('response_sent', 'spot_query_log', array($this, 'debugQueryLog'));
     // Add 'autoinstall' method as callback for 'dispatch_exception' filter when exceptions are encountered
     $kernel->events()->addFilter('dispatch_exception', 'spot_autoinstall_on_exception', array($this, 'autoinstallOnException'));
 }
예제 #2
0
파일: init.php 프로젝트: acidline/rocket
 function Kernel(array $config = array())
 {
     return \Alloy\Kernel::getInstance($config);
 }
예제 #3
0
파일: Plugin.php 프로젝트: acidline/rocket
 /**
  * Initialize plguin
  */
 public function __construct(Alloy\Kernel $kernel)
 {
     // Add 'wrapLayout' method as callback for 'dispatch_content' filter
     $kernel->events()->addFilter('dispatch_content', 'alloy_layout_wrap', array($this, 'wrapLayout'));
 }