public function execute($matches) {
		if (is_string($this->callable)) { // If the callable is a string, call the action of controller
			$params = explode('#', $this->callable);

            if (count($params) == 2) {
                $controllerPrefix = $params[0];
                $controllerPrefix = str_replace(':', '\\', $controllerPrefix);

    			$controller = $controllerPrefix."Controller";

    			$controller = new $controller();
    			$action = $params[1].'Action';

    			return call_user_func_array(array($controller, $action), $matches);


    			return $controller->$action();

            } else {
                throw new RouterException('Invalid controller name '.$this->callable);
            }

		} else { // If the callable is a function, execute the function
			return call_user_func_array($this->callable, $matches);
		}
	}
public function execute($matches) {
		if (is_string($this->callable)) { // If the callable is a string, call the action of controller
			$params = explode('#', $this->callable);

            if (count($params) == 2) {
                $controllerPrefix = $params[0];
                $controllerPrefix = str_replace(':', '\\', $controllerPrefix);

    			$controller = $controllerPrefix."Controller";

    			$controller = new $controller();
    			$action = $params[1].'Action';

    			return call_user_func_array(array($controller, $action), $matches);


    			return $controller->$action();

            } else {
                throw new RouterException('Invalid controller name '.$this->callable);
            }

		} else { // If the callable is a function, execute the function
			return call_user_func_array($this->callable, $matches);
		}
	}
public function execute ( $ matches ) { if ( is_string ( $ this -> callable ) ) { // If the callable is a string, call the action of controller $ params = explode ( '#' , $ this -> callable ) ; if ( count ( $ params ) == 2 ) { $ controllerPrefix = $ params [ 0 ] ; $ controllerPrefix = str_replace ( ':' , '\\' , $ controllerPrefix ) ; $ controller = $ controllerPrefix . "Controller" ; $ controller = new $ controller ( ) ; $ action = $ params [ 1 ] . 'Action' ; return call_user_func_array ( array ( $ controller , $ action ) , $ matches ) ; return $ controller -> $ action ( ) ; } else { throw new RouterException ( 'Invalid controller name ' . $ this -> callable ) ; } } else { // If the callable is a function, execute the function return call_user_func_array ( $ this -> callable , $ matches ) ; } }
Execute the callable of route

@param array $matches URL parameters

@return mixed
Execute the callable of route