protected function setControllerVars($controller)
    {
        $this->controller = $controller;

        if (is_callable($controller)) {
            $this->setControllerCallable($controller);
        } else {
            $this->usesCallable = false;
            $atCharPos = strpos($controller, '@');

            // Make sure the "@" is somewhere in the middle of the string
            if ($atCharPos === false || $atCharPos === 0 || $atCharPos === mb_strlen($controller) - 1) {
                throw new InvalidArgumentException('Controller string is not formatted correctly');
            }

            $this->controllerName = substr($controller, 0, $atCharPos);
            $this->controllerMethod = substr($controller, $atCharPos + 1);
        }
    }
protected function setControllerVars($controller)
    {
        $this->controller = $controller;

        if (is_callable($controller)) {
            $this->setControllerCallable($controller);
        } else {
            $this->usesCallable = false;
            $atCharPos = strpos($controller, '@');

            // Make sure the "@" is somewhere in the middle of the string
            if ($atCharPos === false || $atCharPos === 0 || $atCharPos === mb_strlen($controller) - 1) {
                throw new InvalidArgumentException('Controller string is not formatted correctly');
            }

            $this->controllerName = substr($controller, 0, $atCharPos);
            $this->controllerMethod = substr($controller, $atCharPos + 1);
        }
    }
protected function setControllerVars ( $ controller ) { $ this -> controller = $ controller ; if ( is_callable ( $ controller ) ) { $ this -> setControllerCallable ( $ controller ) ; } else { $ this -> usesCallable = false ; $ atCharPos = strpos ( $ controller , '@' ) ; // Make sure the "@" is somewhere in the middle of the string if ( $ atCharPos === false || $ atCharPos === 0 || $ atCharPos === mb_strlen ( $ controller ) - 1 ) { throw new InvalidArgumentException ( 'Controller string is not formatted correctly' ) ; } $ this -> controllerName = substr ( $ controller , 0 , $ atCharPos ) ; $ this -> controllerMethod = substr ( $ controller , $ atCharPos + 1 ) ; } }
Sets the controller name and method from the raw string

@param string|callable $controller The name of the controller/method or the callback
@throws InvalidArgumentException Thrown if the controller string is not formatted correctly
Sets the controller name and method from the raw string