Created
March 16, 2016 10:49
-
-
Save matej21/8a489139d3b676053a90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function tryCall($method, array $params) | |
{ | |
$type = substr($method, 0, 6); | |
if ($type === 'action') { | |
$this->evm->dispatchEvent(get_class($this) . '::onBeforeAction', new EventArgsList([$this, $this->action])); | |
} elseif ($type === 'render') { | |
$this->evm->dispatchEvent(get_class($this) . '::onBeforeRender', new EventArgsList([$this, $this->view])); | |
} | |
$result = parent::tryCall($method, $params); | |
if ($type === 'action') { | |
$this->evm->dispatchEvent(get_class($this) . '::onAfterAction', new EventArgsList([$this, $this->action])); | |
} elseif ($type === 'render') { | |
$this->evm->dispatchEvent(get_class($this) . '::onAfterRender', new EventArgsList([$this, $this->view])); | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment