You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/controller.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,3 +79,39 @@ If you like to render using Twig you can use the following codes:
79
79
For default template system, Creating layout is same task as create a view file. Create a view file into **{APPDIR}/view/_layouts** like other view files. Then You just need to echo the $content variable where you like to display the partial view within the layout.
80
80
If you are using the twig template engine, then follow the [twig instruction](./twig.md).
81
81
82
+
6. RestFullController:
83
+
----------------------
84
+
A base controller for implementing Rest Api. All controller those serve rest api should extend it instead of CIX_Controller or CI_Controller. A sample
85
+
Controller implementing Api may looks like follow:
86
+
87
+
```php
88
+
89
+
class Api extends \Xiidea\Base\RestFullController {
90
+
91
+
public function access_map(){
92
+
return array(
93
+
'user_get'=>'view',
94
+
'user_post'=>'create',
95
+
'user_put'=>'edit',
96
+
'user_delete'=>'delete',
97
+
);
98
+
}
99
+
100
+
public function user_get(){
101
+
$this->sendResponse(200, json_encode(array('name'=>'Name of user')));
0 commit comments