mvc/Router.php
/**
     * Dispatch to the action method when using a parameter for action method name.
     * If $has_default_method is TRUE, $allow_methods first item value will be as the default value.
     * Return action method result.
     * @param array $allow_methods
     * @param bool $has_default_method
     * @throws UnexpectedValueException
     * @return mixed
     */
Dispatch to the action method when using a parameter for action method name.
If $has_default_method is TRUE, $allow_methods first item value will be as the default value.
Return action method result.
@param array $allow_methods
@param bool $has_default_method
@throws UnexpectedValueException
@return mixed
Dispatch to the action method when using a parameter for action method name . If $has_default_method is TRUE $allow_methods first item value will be as the default value . Return action method result . @param array $allow_methods @param bool $has_default_method @throws UnexpectedValueException @return mixed
public function routeToActionMethod($allow_methods, $has_default_method = TRUE) {
        $asi = $this->getRoutingInfo();
        $action = $asi->action_instance;
        $args = $asi->action_args;
        if (! is_object($action)) {
            throw new \UnexpectedValueException('Invalid action object');
        }
        if (empty($args)) {
            $param = FALSE;
        } else {
            if (! is_array($args)) {
                throw new \UnexpectedValueException('Invalid action method parameters');
            }
            $param = $args[0];
            if ($this->isInvalidFunctionName($param)) {
                $param = FALSE;
            } else {
                array_shift($args);
            }
        }
        $method = $this->parseActionMethod($param, $allow_methods, $has_default_method);
        $this->_action_method_name = $method;
        if (empty($args)) {
            return $action->$method();
        } else {
            return $action->$method($args);
        }
    }
public function routeToActionMethod ( $ allow_methods , $ has_default_method = TRUE ) { $ asi = $ this -> getRoutingInfo ( ) ; $ action = $ asi -> action_instance ; $ args = $ asi -> action_args ; if ( ! is_object ( $ action ) ) { throw new \ UnexpectedValueException ( 'Invalid action object' ) ; } if ( empty ( $ args ) ) { $ param = FALSE ; } else { if ( ! is_array ( $ args ) ) { throw new \ UnexpectedValueException ( 'Invalid action method parameters' ) ; } $ param = $ args [ 0 ] ; if ( $ this -> isInvalidFunctionName ( $ param ) ) { $ param = FALSE ; } else { array_shift ( $ args ) ; } } $ method = $ this -> parseActionMethod ( $ param , $ allow_methods , $ has_default_method ) ; $ this -> _action_method_name = $ method ; if ( empty ( $ args ) ) { return $ action -> $ method ( ) ; } else { return $ action -> $ method ( $ args ) ; } }
Dispatch to the action method when using a parameter for action method name.
Dispatch to the action method when using a parameter for action method name .