Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Router.php adding internalPathFor #1551

Closed
wants to merge 1 commit into from
Closed

Conversation

pokmot
Copy link
Contributor

@pokmot pokmot commented Oct 22, 2015

Suggested code update for issue #1521

@akrabat
Copy link
Member

akrabat commented Oct 22, 2015

We still need pathFor().

The implementation of pathFor() should be:

    /**
     * Build the path for a named route including the base path
     *
     * @param string $name        Route name
     * @param array  $data        Named argument replacement data
     * @param array  $queryParams Optional query string parameters
     *
     * @return string
     *
     * @throws RuntimeException         If named route does not exist
     * @throws InvalidArgumentException If required data not provided
     */
    public function pathFor($name, array $data = [], array $queryParams = [])
    {
        $url = $this->internalPathFor($name, $data, $queryParams);

        if ($this->basePath) {
            $url = $this->basePath . $url;
        }

        return $url;
    }

Also, we need unit tests for internalPathFor

@akrabat
Copy link
Member

akrabat commented Oct 22, 2015

Superseded by #1552

@akrabat akrabat closed this Oct 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants