Foundation/Core.php
public function on($event, $callable)
    {
        if (!is_callable($callable) && !$callable instanceof \Closure)
            throw new \InvalidArgumentException();

        if (!isset($this->_hooks[$event]))
            $this->_hooks[$event] = array();

        $this->_hooks[$event][] = $callable;

        return $this;
    }
public function on($event, $callable)
    {
        if (!is_callable($callable) && !$callable instanceof \Closure)
            throw new \InvalidArgumentException();

        if (!isset($this->_hooks[$event]))
            $this->_hooks[$event] = array();

        $this->_hooks[$event][] = $callable;

        return $this;
    }
public function on ( $ event , $ callable ) { if ( ! is_callable ( $ callable ) && ! $ callable instanceof \ Closure ) throw new \ InvalidArgumentException ( ) ; if ( ! isset ( $ this -> _hooks [ $ event ] ) ) $ this -> _hooks [ $ event ] = array ( ) ; $ this -> _hooks [ $ event ] [ ] = $ callable ; return $ this ; }
Binds a new callable action to a hook event.

@param string $event
@param \Closure|callable $callable
@return \m\Foundation\Core
@throws \InvalidArgumentException
Binds a new callable action to a hook event .