public function namedTo(string $name, Router $router, bool $register = false): void
    {
        // not empty
        if ($name = $this->setName($name)->name) {
            if ($register) {
                $router->addRoute($this);
            } else {
                $router->nameRoute($name, $this);
            }
        }
    }
public function namedTo(string $name, Router $router, bool $register = false): void
    {
        // not empty
        if ($name = $this->setName($name)->name) {
            if ($register) {
                $router->addRoute($this);
            } else {
                $router->nameRoute($name, $this);
            }
        }
    }
public function namedTo ( string $ name , Router $ router , bool $ register = false ) : void { // not empty if ( $ name = $ this -> setName ( $ name ) -> name ) { if ( $ register ) { $ router -> addRoute ( $ this ) ; } else { $ router -> nameRoute ( $ name , $ this ) ; } } }
name the route and bind name to router.
@param string $name
@param Router $router
@param bool   $register
name the route and bind name to router .