Comments (4)
I'm curious about this. Though it does seem to break a fair bit of the routing that's in place now and I can't really see the advantage of using $this->input->get('productType')
as opposed to $productType
as a passed parameter to the controller / closure? Maybe I'm missing something.
Ben
from framework.
Hi Ben, I don't want to remove route parameters as arguments. I was just looking for a unified way to access route parameters and user input because in some cases (that I'm working with) they're semantically similar.
Something like Input::getWithRouteParameters('myParameter')
or Input::allWithRouteParameters()
(and perhaps not so ugly).
The second half of my thought process was really the fact that the Request isn't injected into the Controller in any explicit way. The Request is held within the context of the Router and to access it one must appeal to the global App container and eg. $app['router']->getRequest()->input('myParameter')
which feels a bit too much like global state for me. I almost expect the request to be injected into the Controller eg:
$this->request->input('myParameter');
$this->request->all();
Anyway I feel like I've talked myself in circles. I can see how easy this will be to add to my BaseController so I might just go back to hacking around on my app until I clear up for myself what I'm really going on about :)
from framework.
Hmm. I have noticed that too, how you have no access to the request from a controller. It has been a bit annoying before for me too. Maybe that's it's own issue
Sent from my iPhone
Please excuse my brevity
On 15/01/2013, at 7:54 PM, stephenfrank [email protected] wrote:
Hi Ben, I don't want to remove route parameters as arguments. I was just looking for a unified way to access route parameters and user input because in some cases (that I'm working with) they're semantically similar.
Something like Input::getWithRouteParameters('myParameter') or Input::allWithRouteParameters() (and perhaps not so ugly).
The second half of my thought process was really the fact that the Request isn't injected into the Controller in any explicit way. The Request is held within the context of the Router and to access it one must appeal to the global App container and eg. $app['router']->getRequest()->input('myParameter') which feels a bit too much like global state for me. I almost expect the request to be injected into the Controller eg:
$this->request->input('myParameter');
$this->request->all();
Anyway I feel like I've talked myself in circles. I can see how easy this will be to add to my BaseController so I might just go back to hacking around on my app until I clear up for myself what I'm really going on about :)—
Reply to this email directly or view it on GitHub.
from framework.
I don't see a huge need for this at the moment. Thanks for the suggestion.
from framework.
Related Issues (20)
- Migration is not working as expected (as written in docs) HOT 5
- Potential infinite recursion when executing `schema:dump` HOT 2
- Potential infinite recursion when executing `schema:dump` HOT 11
- Custom validation rules break generated error MessageBag when custom messages are defined HOT 2
- limit() in relationship load extremely slow in Laravel 11 HOT 2
- Listeners are handled within transactions despite the ShouldHandleEventsAfterCommit interface
- Laravel 11 auto session=database throws intermittent SQLSTATE[08004] [1040] Too many connections error HOT 5
- DatabaseRule "unique" fails quietly when given an incorrect column HOT 4
- Where Query with Arrays for JSON Columns HOT 7
- Adding a batch to a chain through prependToChain/appendToChain results in serialization errors HOT 2
- Cannot override default error page with Laravel 11 Bootstrap Exception Handling HOT 2
- firstOrNew on belongsToMany doesn't work as expected HOT 3
- Accessor date casting formatting as UTC when being serialized to JSON. HOT 1
- Contextual binding resolved when it shouldn't be for LogManager HOT 1
- Using Emergency logging channel throw an exception HOT 3
- Sqlite column processing crashes when column has a "/" in its name
- Database migrations in pretend mode doesn't display insert statements to migrations table HOT 3
- Job runs longer than "retry_after" will re-run immediately once the "retry after" seconds passed. HOT 1
- Unexpected behaviour when chunking a query HOT 3
- Artisan db:show and db:table fails when database has tables in multiple schemas HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.