public function setName($name)
    {
        if ($this->lock) {
            throw new Exception('Route cannot be modified');
        }

        if (empty($name)) {
            return $name;
        }

        //Add group name if any
        $groupName = implode('', Router::$groupsProps['name']);
        $this->name = $groupName . $name;

        //Register
        Router::getInstance()->registerNamedRoute($this);

        return $this;
    }
public function setName($name)
    {
        if ($this->lock) {
            throw new Exception('Route cannot be modified');
        }

        if (empty($name)) {
            return $name;
        }

        //Add group name if any
        $groupName = implode('', Router::$groupsProps['name']);
        $this->name = $groupName . $name;

        //Register
        Router::getInstance()->registerNamedRoute($this);

        return $this;
    }
public function setName ( $ name ) { if ( $ this -> lock ) { throw new Exception ( 'Route cannot be modified' ) ; } if ( empty ( $ name ) ) { return $ name ; } //Add group name if any $ groupName = implode ( '' , Router :: $ groupsProps [ 'name' ] ) ; $ this -> name = $ groupName . $ name ; //Register Router :: getInstance ( ) -> registerNamedRoute ( $ this ) ; return $ this ; }
Sets the name of this route and registers it in the Router
@param $name
@return $this
@throws Exception
Sets the name of this route and registers it in the Router