The more and more projects starting to use this approach. When server provides only API. And all other work are performed by your device phone/browser. You do not need to render or return html it’s a work for client.
If you created created backend for some phone app you have to face with the same problems as me.
And what yii1/yii2 provides us.
- Good routes system. Some propositions
-
I remeber you guys (@yiiteam) wanted to implement nested routes. I think it would be very useful. What is the status of that stuff?
-
nice routes. I still need to extend default routes to something like this
array('<controller>/list', 'pattern' => '<controller:[\w\-]+?>s', 'verb' => 'GET'),
// I don't have ability do the same for es- endings, i.e. entit(ies) specialt(ies) without extending core urlManager.
- Request class
- I already wrote that it would be nice to have ability automatically decode raw data.
Why you guys don’t want to introduce this feature in yii2 ?
-
How can I get POST data uploaded through request payload. Iphone guys like this feature
-
How could I get all the POST data without accessing global $_POST. It’s a good practice to have read-only access to $_POST/$_GET from your controllers. So why we have
getPost($name,$defaultValue=null)
instead of
getPost($name=null, $defaultValue=null)
The same story with PUT. How can I get all the PUT data uploaded via POST (i.e. _method=PUT. This approach sometime useful for testing) in my controller.
$putData = $_POST;
or $putData = Yii::app()->request->getRestParams()
No this is REST, this put request PUT /user/123 and I wanna get put data.
$user->update($this->getPutData())
- From provious note
What about adding shorthand for Controller
$this->getPost() VS Yii::$app->request->getPost()
Thoughts?
Thanks