File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,11 +20,10 @@ See [Examples](https://github.com/tipsyphp/tipsy/wiki/Examples) for more detaile
2020
2121###### index.php
2222``` php
23- $tipsy->router()
24- ->home(function($Scope, $View) {
25- $Scope->user = 'Mai Tai';
26- $View->display('hello');
27- });
23+ $app->home(function($Scope, $View) {
24+ $Scope->user = 'Mai Tai';
25+ $View->display('hello');
26+ });
2827```
2928
3029###### hello.phtml
@@ -37,15 +36,18 @@ $tipsy->router()
3736###### index.php
3837
3938``` php
40- $tipsy->router()
41- ->delete('api/maitai/:id', function($Params) {
42- echo json_encode([message => $Params->id]);
39+ $app->post('drink/:id', function($Params, $Request, $Maitai) {
40+ $Maitai
41+ ->load($Params->id)
42+ ->serialize($Request->request())
43+ ->save();
44+ echo $Maitai->json()
4345 });
4446```
4547
46- ###### DELETE /api/maitai/1
48+ ###### POST /drink/1?rating=5&name=maitai
4749```
48- {"message ": 1}
50+ {"id ": 1, "name": "maitai", "rating": 5 }
4951```
5052
5153---
You can’t perform that action at this time.
0 commit comments