-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added messages support, fixed db_conn snippet and added html table sn…
…ippets
- Loading branch information
Showing
9 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
\$table = new \CodeIgniter\View\Table(); | ||
\$data = [ | ||
['Name', 'Color', 'Size'], | ||
['Fred', 'Blue', 'Small'], | ||
['Mary', 'Red', 'Large'], | ||
['John', 'Green', 'Medium'], | ||
]; | ||
echo \$table->generate(\$data); | ||
]]></content> | ||
<tabTrigger>ci_html_table</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>CI4 - The Table Class provides methods that enable you to auto-generate HTML tables</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
\$table = new \CodeIgniter\View\Table(); | ||
\$query = $db->query('SELECT * FROM my_table'); | ||
echo \$table->generate($query); | ||
]]></content> | ||
<tabTrigger>ci_query_table</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>CI4 - Table created from a database query result</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
\$template = [ | ||
'table_open' => '${1:<table border="0" cellpadding="4" cellspacing="0">}', | ||
'thead_open' => '${2:<thead>}', | ||
'thead_close' => '${3:</thead>}', | ||
'heading_row_start' => '${4:<tr>}', | ||
'heading_row_end' => '${5:</tr>}', | ||
'heading_cell_start' => '${6:<th>}', | ||
'heading_cell_end' => '${7:</th>}', | ||
'tfoot_open' => '${8:<tfoot>}', | ||
'tfoot_close' => '${9:</tfoot>}', | ||
'footing_row_start' => '${10:<tr>}', | ||
'footing_row_end' => '${11:</tr>}', | ||
'footing_cell_start' => '${12:<td>}', | ||
'footing_cell_end' => '${13:</td>}', | ||
'tbody_open' => '${14:<tbody>}', | ||
'tbody_close' => '${15:</tbody>}', | ||
'row_start' => '${16:<tr>}', | ||
'row_end' => '${17:</tr>}', | ||
'cell_start' => '${18:<td>}', | ||
'cell_end' => '${19:</td>}', | ||
'row_alt_start' => '${20:<tr>}', | ||
'row_alt_end' => '${21:</tr>}', | ||
'cell_alt_start' => '${22:<td>}', | ||
'cell_alt_end' => '${23:</td>}', | ||
'table_close' => '${24:</table>}' | ||
]; | ||
\$table->setTemplate($template); | ||
]]></content> | ||
<tabTrigger>ci_table_template</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>CI4 - Set a table template with which you can specify the design of your layout</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
\$db = \Config\Database::connect(); | ||
\$builder = $db->table('${1:table_name}'); | ||
]]></content> | ||
<tabTrigger>ci_db_connr</tabTrigger> | ||
<tabTrigger>ci_conn</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>CI4 - Create a new database connection</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"install": "messages/install.txt", | ||
"1.0.20": "messages/1.0.20.txt", | ||
"1.0.24": "messages/1.0.24.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Added some more codeigniter 4 snippets to our repo | ||
|
||
ci_entity - Create a new Entity class | ||
ci_cache - Save into the cache for x minutes | ||
ci_getcache - Grab an instance of the cache engine directly through the Services class | ||
ci_email - Basic example demonstrating how you might send email | ||
ci_email_config - Basic email Preferences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
1.0.24 | ||
|
||
- Added messages | ||
- Added html table | ||
+ ci_html_table - Create a basic html table based in a given array | ||
+ ci_query_table - Create a basic html table based in query result | ||
+ ci_table_template - Set your basic html table layout | ||
- Fixed ci_db_conn snippet | ||
- Updated readme file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This is a Sublime Text package which includes a bunch of handy snippets for doing Codeigniter 4 framework development. | ||
|
||
If you find any problems please submit a pull request to: https://github.com/mpmont/ci4-snippets | ||
|
||
Have any snippets for codeigniter 4 in your sublime install? Submit them here: https://github.com/mpmont/ci4-snippets | ||
|
||
Thanks to all our contributors: | ||
|
||
- Marco Monteiro | ||
- haerunn |