Skip to content

Commit

Permalink
Add more snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardojunio committed Mar 22, 2015
1 parent 02059ce commit 1f54b01
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CodeIgniter_Autocomplete_Snippets_Doc.tgn
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{\"rows_views\":[[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"bottom\":10,\"left\":5,\"right\":5}}}]],\"model\":{\"rows\":[[{\"value\":\"Snippet Name\",\"cspan\":1,\"rspan\":1},{\"value\":\"Tab Trigger\",\"cspan\":1,\"rspan\":1},{\"value\":\"Description\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Controller\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_controller\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generate a basic CodeIgniter controller.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Model\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_model\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generate a basic CodeIgniter model.\",\"cspan\":1,\"rspan\":1}]]},\"theme\":null,\"fixed_layout\":false}
{\"rows_views\":[[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}],[{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}},{\"style\":{\"borders\":\"lrtb\",\"font_style\":{},\"text_color\":\"\",\"bg_color\":\"\",\"halign\":\"left\",\"padding\":{\"top\":10,\"right\":5,\"bottom\":10,\"left\":5}}}]],\"model\":{\"rows\":[[{\"value\":\"Snippet Name\",\"cspan\":1,\"rspan\":1},{\"value\":\"Tab Trigger\",\"cspan\":1,\"rspan\":1},{\"value\":\"Description\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Controller\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_controller\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates a basic CodeIgniter controller.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Database Delete Query\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_db_delete\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates a delete SQL string and runs the query.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Database Get Query\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_db_get\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates a select SQL string and runs the query.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Database Get Where Query\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_db_get_where\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates a select where SQL string and runs the query.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Database Insert Query\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_db_insert\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates an insert string based on the data you supply, and runs the query.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Database Update Query\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_db_update\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates an update string and runs the query based on the data you supply.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Database Where Query\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_db_where\",\"cspan\":1,\"rspan\":1},{\"value\":\"This snippet enables you to set WHERE clauses.\",\"cspan\":1,\"rspan\":1}],[{\"value\":\"CodeIgniter Model\",\"cspan\":1,\"rspan\":1},{\"value\":\"ci_model\",\"cspan\":1,\"rspan\":1},{\"value\":\"Generates a basic CodeIgniter model.\",\"cspan\":1,\"rspan\":1}]]},\"theme\":null,\"fixed_layout\":false}
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ Click on **Download ZIP** in the right side and save the file on the your Sublim
After that, extract the file and be happy coding with CodeIgniter!

## Snippets list
| Snippet Name | Tab Trigger | Description |
|------------------------|---------------|------------------------------------------|
| CodeIgniter Controller | ci_controller | Generate a basic CodeIgniter controller. |
| CodeIgniter Model | ci_model | Generate a basic CodeIgniter model. |
| Snippet Name | Tab Trigger | Description |
|--------------------------------------|-----------------|------------------------------------------------------------------------------|
| CodeIgniter Controller | ci_controller | Generates a basic CodeIgniter controller. |
| CodeIgniter Database Delete Query | ci_db_delete | Generates a delete SQL string and runs the query. |
| CodeIgniter Database Get Query | ci_db_get | Generates a select SQL string and runs the query. |
| CodeIgniter Database Get Where Query | ci_db_get_where | Generates a select where SQL string and runs the query. |
| CodeIgniter Database Insert Query | ci_db_insert | Generates an insert string based on the data you supply, and runs the query. |
| CodeIgniter Database Update Query | ci_db_update | Generates an update string and runs the query based on the data you supply. |
| CodeIgniter Database Where Query | ci_db_where | This snippet enables you to set WHERE clauses. |
| CodeIgniter Model | ci_model | Generates a basic CodeIgniter model. |

Table generated with http://www.tablesgenerator.com/markdown_tables
11 changes: 11 additions & 0 deletions Snippets/CodeIgniter Database Delete Query.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
\$this->db->delete('${1:mytable}'${2:, array('${3:id}' => ${4:\$id})})${5:}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ci_db_delete</tabTrigger>
<scope>text.html, source.php</scope>
</snippet>
11 changes: 11 additions & 0 deletions Snippets/CodeIgniter Database Get Query.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
\$this->db->get('${1:mytable}')${2:}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ci_db_get</tabTrigger>
<scope>text.html, source.php</scope>
</snippet>
11 changes: 11 additions & 0 deletions Snippets/CodeIgniter Database Get Where Query.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
\$this->db->get_where('${1:mytable}', array('${2:id}' => ${3:\$id})${4:, \$limit, \$offset})${5:}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ci_db_get_where</tabTrigger>
<scope>text.html, source.php</scope>
</snippet>
11 changes: 11 additions & 0 deletions Snippets/CodeIgniter Database Insert Query.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
\$this->db->insert('${1:mytable}', ${2:array('${3:field}' => ${4:\$value})})${5:}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ci_db_insert</tabTrigger>
<scope>text.html, source.php</scope>
</snippet>
11 changes: 11 additions & 0 deletions Snippets/CodeIgniter Database Update Query.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
\$this->db->update('${1:mytable}', ${2:array('${3:field}' => ${4:\$value})})${5:}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ci_db_update</tabTrigger>
<scope>text.html, source.php</scope>
</snippet>
11 changes: 11 additions & 0 deletions Snippets/CodeIgniter Database Where Query.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
\$this->db->where('${1:id}', ${2:\$id})${3:}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ci_db_where</tabTrigger>
<scope>text.html, source.php</scope>
</snippet>

0 comments on commit 1f54b01

Please sign in to comment.