Skip to content

Instantly share code, notes, and snippets.

@harikt
Created July 9, 2015 16:36
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save harikt/6bd6b0f55098c511c1a1 to your computer and use it in GitHub Desktop.
<?php
class Hello
{
protected $signal;
// more deps
public function __construct(Signal $signal)
{
$this->signal = $signal;
// add handler
$this->signal->handler($this, 'pre_action', [$this, 'preAction']);
}
// Eg : https://github.com/auraphp/Aura.Signal
public function preAction()
{
}
// more setters
}
$di->params['Hello']['signal'] = $di->lazyGet('signal');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment