Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Allow null value for route name in PRG plugin #2242

Merged

Conversation

juriansluiman
Copy link
Contributor

In a lot of PRG patterns the POST request happens to the same url as the GET request. This PR keeps the flexibility to set the route name but it also defaults to the currently matched route name.

Previously I did:

$route = $this->getEvent()->getRouteMatch()->getMatchedRouteName();

if (($result = $this->prg($route)) instanceof Response) {
    return $result;
}  elseif (false !== $result) {
    // Do stuff
}

Where now you're able to:

if (($result = $this->prg()) instanceof Response) {
    return $result;
}  elseif (false !== $result) {
    // Do stuff
}

Test is made to assert the behaviour.

Jurian Sluiman added 2 commits August 26, 2012 11:03
In a lot of PRG patterns the POST request happens to the same url
as the GET request. It keeps the flexibility to set the route name
but it also defaults to the current matched route name.
weierophinney added a commit that referenced this pull request Aug 28, 2012
- Detailed the null route
@weierophinney weierophinney merged commit 9799715 into zendframework:master Aug 28, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants