forked from mpmont/ci-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crud.sublime-snippet
47 lines (35 loc) · 1014 Bytes
/
crud.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<snippet>
<content><![CDATA[
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ${1:${TM_FILENAME/(.+)\..+|.*/\u$1/:Controllername}} extends ${2:CI}_Controller {
public function __construct()
{
parent::__construct();
${0://Load Dependencies}
}
// List all your items
public function index( \$offset = 0 )
{
}
// Add a new item
public function add()
{
}
//Update one item
public function update( \$id = NULL )
{
}
//Delete one item
public function delete( \$id = NULL )
{
}
}
/* End of file ${1/(.+)/\l$1/:Controllername}.php */
/* Location: ./application/controllers/${1/(.+)/\l$1/:Controllername}.php */
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>crud</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
<description>CI - Simple CRUD Controller</description>
</snippet>