public function setTarget($target)
    {
        //Add to route group if any
        if (!$target instanceof \Closure) {
            $groupNamespace = implode('\\', Router::$groupsProps['namespace']);
            $target = $groupNamespace ? "$groupNamespace\\$target" : $target;
        }

        if (!$target instanceof Closure &&
                !preg_match(Router::TARGET_REGEX, $target)) {
            throw new Exception("Invalid target string $target");
        }
        $this->target = $target;

        return $this;
    }
public function setTarget($target)
    {
        //Add to route group if any
        if (!$target instanceof \Closure) {
            $groupNamespace = implode('\\', Router::$groupsProps['namespace']);
            $target = $groupNamespace ? "$groupNamespace\\$target" : $target;
        }

        if (!$target instanceof Closure &&
                !preg_match(Router::TARGET_REGEX, $target)) {
            throw new Exception("Invalid target string $target");
        }
        $this->target = $target;

        return $this;
    }
public function setTarget ( $ target ) { //Add to route group if any if ( ! $ target instanceof \ Closure ) { $ groupNamespace = implode ( '\\' , Router :: $ groupsProps [ 'namespace' ] ) ; $ target = $ groupNamespace ? "$groupNamespace\\$target" : $ target ; } if ( ! $ target instanceof Closure && ! preg_match ( Router :: TARGET_REGEX , $ target ) ) { throw new Exception ( "Invalid target string $target" ) ; } $ this -> target = $ target ; return $ this ; }
Sets the target controller or closure for this route
@param $target
@return $this
@throws Exception
Sets the target controller or closure for this route