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

Optionally allow GET requests to reach controllers #25

Open
pointybeard opened this issue Nov 12, 2020 · 1 comment
Open

Optionally allow GET requests to reach controllers #25

pointybeard opened this issue Nov 12, 2020 · 1 comment
Assignees

Comments

@pointybeard
Copy link
Owner

pointybeard commented Nov 12, 2020

Currently there is a hard 'no' on GET requests which prevents them from getting to the controller. Instead, in the Controller event, it drops out and lets Symphony handle it internally before the JSON result is then rendered. See:

if ($request->getMethod() == 'GET') {

It would be nice if there was a way to indicate that GET requests need to go through to the controller. Perhaps it's as simple as checking for a get() method on the controller like the other HTTP request methods do. The logic for this could go here:

// Throw an exception if it cannot be located.
if (!class_exists($controllerPath)) {
throw new Lib\Exceptions\ControllerNotFoundException($controllerPath);
}

@pointybeard
Copy link
Owner Author

Also need a way for a controller to signal that GET requests should or should not fall through to the Symphony core renderer.

pointybeard added a commit that referenced this issue Nov 14, 2020
…eaders set correctly on GET requests. Fixes #26 and closes #25
pointybeard added a commit that referenced this issue Nov 14, 2020
…eaders set correctly on GET requests. Fixes #26 and closes #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant