public function addMiddleware(Middleware $middleware)
    {
        $group = $middleware->getGroup();
        if (! isset($this->middleware[$group])) {
            $this->middleware[$group] = array(
                'before' => array(),
                'after' => array()
            );
        }

        $this->middleware[$group][$middleware->getPosition()][] = &$middleware;
    }
public function addMiddleware(Middleware $middleware)
    {
        $group = $middleware->getGroup();
        if (! isset($this->middleware[$group])) {
            $this->middleware[$group] = array(
                'before' => array(),
                'after' => array()
            );
        }

        $this->middleware[$group][$middleware->getPosition()][] = &$middleware;
    }
public function addMiddleware ( Middleware $ middleware ) { $ group = $ middleware -> getGroup ( ) ; if ( ! isset ( $ this -> middleware [ $ group ] ) ) { $ this -> middleware [ $ group ] = array ( 'before' => array ( ) , 'after' => array ( ) ) ; } $ this -> middleware [ $ group ] [ $ middleware -> getPosition ( ) ] [ ] = & $ middleware ; }
Add middleware trigger to registry.

@param Middleware $middleware
Add middleware trigger to registry .