diff --git a/README.md b/README.md index 3d75c7a..eda74c4 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Codeigniter 4 Snippets for Sublime Text 2/3 [![Codeigniter](https://img.shields.io/badge/Codeigniter-v4.0-orange.svg)](http://codeigniter.com/) +[![Downloads](https://packagecontrol.herokuapp.com/downloads/CodeIgniter%20Snippets.svg?color=80d4cd)](https://packagecontrol.io/packages/CodeIgniter%204%20Snippets) + This is a [Sublime Text][sublime] package which includes a bunch of handy snippets for doing Codeigniter 4 framework development. ### Easy installation ### @@ -60,6 +62,9 @@ If you find error or whatever just fork it and send me a pull request. | 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 | +| 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 | # Contributors diff --git a/ci4_html_table.sublime-snippet b/ci4_html_table.sublime-snippet new file mode 100644 index 0000000..ff976cf --- /dev/null +++ b/ci4_html_table.sublime-snippet @@ -0,0 +1,15 @@ + + generate(\$data); +]]> + ci_html_table + source.php + CI4 - The Table Class provides methods that enable you to auto-generate HTML tables + \ No newline at end of file diff --git a/ci4_query_table.sublime-snippet b/ci4_query_table.sublime-snippet new file mode 100644 index 0000000..87cb532 --- /dev/null +++ b/ci4_query_table.sublime-snippet @@ -0,0 +1,10 @@ + + query('SELECT * FROM my_table'); +echo \$table->generate($query); +]]> + ci_query_table + source.php + CI4 - Table created from a database query result + \ No newline at end of file diff --git a/ci4_table_template.sublime-snippet b/ci4_table_template.sublime-snippet new file mode 100644 index 0000000..44d43d5 --- /dev/null +++ b/ci4_table_template.sublime-snippet @@ -0,0 +1,43 @@ + + '${1:}', + + 'thead_open' => '${2:}', + 'thead_close' => '${3:}', + + 'heading_row_start' => '${4:}', + 'heading_row_end' => '${5:}', + 'heading_cell_start' => '${6:}', + + 'tfoot_open' => '${8:}', + 'tfoot_close' => '${9:}', + + 'footing_row_start' => '${10:}', + 'footing_row_end' => '${11:}', + 'footing_cell_start' => '${12:}', + + 'tbody_open' => '${14:}', + 'tbody_close' => '${15:}', + + 'row_start' => '${16:}', + 'row_end' => '${17:}', + 'cell_start' => '${18:}', + + 'row_alt_start' => '${20:}', + 'row_alt_end' => '${21:}', + 'cell_alt_start' => '${22:}', + + 'table_close' => '${24:
}', + 'heading_cell_end' => '${7:
}', + 'footing_cell_end' => '${13:
}', + 'cell_end' => '${19:
}', + 'cell_alt_end' => '${23:
}' +]; + +\$table->setTemplate($template); +]]>
+ ci_table_template + source.php + CI4 - Set a table template with which you can specify the design of your layout +
\ No newline at end of file diff --git a/ci_db_conn.sublime-snippet b/ci_db_conn.sublime-snippet index 8a54467..eb67ad7 100644 --- a/ci_db_conn.sublime-snippet +++ b/ci_db_conn.sublime-snippet @@ -1,8 +1,9 @@ table('${1:table_name}'); ]]> - ci_db_connr + ci_conn source.php CI4 - Create a new database connection \ No newline at end of file diff --git a/messages.json b/messages.json new file mode 100644 index 0000000..f4daf05 --- /dev/null +++ b/messages.json @@ -0,0 +1,5 @@ +{ +"install": "messages/install.txt", +"1.0.20": "messages/1.0.20.txt", +"1.0.24": "messages/1.0.24.txt" +} \ No newline at end of file diff --git a/messages/1.0.20.txt b/messages/1.0.20.txt new file mode 100644 index 0000000..75a97a2 --- /dev/null +++ b/messages/1.0.20.txt @@ -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 \ No newline at end of file diff --git a/messages/1.0.24.txt b/messages/1.0.24.txt new file mode 100644 index 0000000..999219e --- /dev/null +++ b/messages/1.0.24.txt @@ -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 diff --git a/messages/install.txt b/messages/install.txt new file mode 100644 index 0000000..87405b7 --- /dev/null +++ b/messages/install.txt @@ -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 \ No newline at end of file