public function register($method, $url, $action)
    {
        if (in_array($method, $this->_methods)) {
            if (is_array($action)) {
                if (!empty($action)) {
                    $exp = explode('@', $action['uses']);
                    $this->_routes[] = [
                        'controller' => $exp[0],
                        'action'     => $exp[1],
                        'method'     => $method,
                        'uri'        => $url,
                    ];
                } else {
                    throw new \Exception('Cannot leave the action empty!');
                }
            } else {
                $exp = explode('@', $action);
                $this->_routes[] = [
                    'controller' => $exp[0],
                    'action'     => $exp[1],
                    'method'     => $method,
                    'uri'        => $url,
                ];
            }
        } else {
            throw new \Exception('Invalid routing method!');
        }
    }
public function register($method, $url, $action)
    {
        if (in_array($method, $this->_methods)) {
            if (is_array($action)) {
                if (!empty($action)) {
                    $exp = explode('@', $action['uses']);
                    $this->_routes[] = [
                        'controller' => $exp[0],
                        'action'     => $exp[1],
                        'method'     => $method,
                        'uri'        => $url,
                    ];
                } else {
                    throw new \Exception('Cannot leave the action empty!');
                }
            } else {
                $exp = explode('@', $action);
                $this->_routes[] = [
                    'controller' => $exp[0],
                    'action'     => $exp[1],
                    'method'     => $method,
                    'uri'        => $url,
                ];
            }
        } else {
            throw new \Exception('Invalid routing method!');
        }
    }
public function register ( $ method , $ url , $ action ) { if ( in_array ( $ method , $ this -> _methods ) ) { if ( is_array ( $ action ) ) { if ( ! empty ( $ action ) ) { $ exp = explode ( '@' , $ action [ 'uses' ] ) ; $ this -> _routes [ ] = [ 'controller' => $ exp [ 0 ] , 'action' => $ exp [ 1 ] , 'method' => $ method , 'uri' => $ url , ] ; } else { throw new \ Exception ( 'Cannot leave the action empty!' ) ; } } else { $ exp = explode ( '@' , $ action ) ; $ this -> _routes [ ] = [ 'controller' => $ exp [ 0 ] , 'action' => $ exp [ 1 ] , 'method' => $ method , 'uri' => $ url , ] ; } } else { throw new \ Exception ( 'Invalid routing method!' ) ; } }
Registers each route.

@param string $method - Route's request method
@param string $url    - Route's URL
@param mixed  $action - Route's action

@throws \Exception

@return void
Registers each route .