public function prefix($prefix, callable $cb)
    {
        $prefix = rtrim($prefix, '/');

        if (!preg_match('@^/@', $prefix)) {
            $prefix = '/' . $prefix;
        }

        if ($this->prefix !== null) {
            $this->prefix .= $prefix;
        } else {
            $this->prefix = $prefix;
        }

        call_user_func_array($cb, [$this]);

        $this->prefix = '';

        return $this;
    }
public function prefix($prefix, callable $cb)
    {
        $prefix = rtrim($prefix, '/');

        if (!preg_match('@^/@', $prefix)) {
            $prefix = '/' . $prefix;
        }

        if ($this->prefix !== null) {
            $this->prefix .= $prefix;
        } else {
            $this->prefix = $prefix;
        }

        call_user_func_array($cb, [$this]);

        $this->prefix = '';

        return $this;
    }
public function prefix ( $ prefix , callable $ cb ) { $ prefix = rtrim ( $ prefix , '/' ) ; if ( ! preg_match ( '@^/@' , $ prefix ) ) { $ prefix = '/' . $ prefix ; } if ( $ this -> prefix !== null ) { $ this -> prefix .= $ prefix ; } else { $ this -> prefix = $ prefix ; } call_user_func_array ( $ cb , [ $ this ] ) ; $ this -> prefix = '' ; return $ this ; }
Add a prefix on the roads

@param string $prefix
@param callable $cb

@return Application

@throws
Add a prefix on the roads