Example #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'));
 }
Example #2
0
 function Kernel(array $config = array())
 {
     return \Alloy\Kernel::getInstance($config);
 }
Example #3
0
 /**
  * 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'));
 }