src/FlexPress/Components/Routing/Route.php
public function setCallable($callableExpression)
    {

        if (strpos("@", $callableExpression) === false) {
            $callableExpression .= "@indexAction";
        }

        list($controllerName, $action) = explode("@", $callableExpression);

        $controller = $this->pimple[$controllerName];

        $callable = array(
            $controller,
            $action
        );

        if (!is_callable($callable)) {

            $message = "The callable you have provided is not callable, if you did not provide a action then ";
            $message .= "indexAction will be called on your given controller";

            throw new \InvalidArgumentException($message);
        }

        $this->callable = $callable;
    }
public function setCallable($callableExpression)
    {

        if (strpos("@", $callableExpression) === false) {
            $callableExpression .= "@indexAction";
        }

        list($controllerName, $action) = explode("@", $callableExpression);

        $controller = $this->pimple[$controllerName];

        $callable = array(
            $controller,
            $action
        );

        if (!is_callable($callable)) {

            $message = "The callable you have provided is not callable, if you did not provide a action then ";
            $message .= "indexAction will be called on your given controller";

            throw new \InvalidArgumentException($message);
        }

        $this->callable = $callable;
    }
public function setCallable ( $ callableExpression ) { if ( strpos ( "@" , $ callableExpression ) === false ) { $ callableExpression .= "@indexAction" ; } list ( $ controllerName , $ action ) = explode ( "@" , $ callableExpression ) ; $ controller = $ this -> pimple [ $ controllerName ] ; $ callable = array ( $ controller , $ action ) ; if ( ! is_callable ( $ callable ) ) { $ message = "The callable you have provided is not callable, if you did not provide a action then " ; $ message .= "indexAction will be called on your given controller" ; throw new \ InvalidArgumentException ( $ message ) ; } $ this -> callable = $ callable ; }
Sets the controller and action

@param $callableExpression - A string in the format 'controller@action'
@throws \InvalidArgumentException
@author Tim Perry
Sets the controller and action