Skip to content

Commit

Permalink
Correct some spaces in some of the snippets and add new contributor a…
Browse files Browse the repository at this point in the history
…nd new ci_filter snippet
  • Loading branch information
mpmont committed Apr 13, 2020
1 parent b8cb6f4 commit de26af4
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 26 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If you find error or whatever just fork it and send me a pull request.
| ci_new_renderer | New View Renderer |
| ci_render_section =ci_log | Logging information> Render section view |
| ci_extend_layout | Extend layout (insert view into a layout) |
| ci_view_section | View section (content within a view that extends a layout) |
| ci_view_section | View section (content within a view that extends a layout)
| ci_view_include | View include |
| ci_get_locale | Get Locale |
| load_database | Load the Database |
Expand All @@ -53,7 +53,9 @@ If you find error or whatever just fork it and send me a pull request.
| ci_iscli | Check if request is CLI |
| ci_issecure | Check if request is HTTPS |
| ci_log | Logging information |
| ci_filter | Create a new filter class |

# Contributors

[Marco Monteiro](https://marcomonteiro.net)
[haerunn](https://github.com/haerunn)
10 changes: 5 additions & 5 deletions ci4_add_route_closure.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<snippet>
<content><![CDATA[
\$routes->add('${1:(:any)}', function()
{
\$${1:rss} = new ${2:RSSFeeder}();
return \$${3:rss}->${4:feed}('${5:general}');
});
\$routes->add('${1:(:any)}', function()
{
\$${1:rss} = new ${2:RSSFeeder}();
return \$${3:rss}->${4:feed}('${5:general}');
});
]]></content>
<tabTrigger>ci_addrouteclosure</tabTrigger>
<scope>source.php</scope>
Expand Down
27 changes: 27 additions & 0 deletions ci4_filter.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<snippet>
<content><![CDATA[
<?php namespace App\Filters;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Filters\FilterInterface;
class ${1:${TM_FILENAME/(.+)\..+|.*/\u$1/:FilterName}}Filter implements FilterInterface
{
public function before(RequestInterface $request)
{
${2}
}
//--------------------------------------------------------------------
public function after(RequestInterface $request, ResponseInterface $response)
{
${3}
}
}
]]></content>
<tabTrigger>ci_filter</tabTrigger>
<scope>source.php, text.html.basic, text.plain</scope>
<description>CI4 - Base Controller</description>
</snippet>
2 changes: 1 addition & 1 deletion ci4_getCookie.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$request->getCookie('${1:var_name}');
\$request->getCookie('${1:var_name}');
]]></content>
<tabTrigger>ci_getCookie</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_getGet.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$request->getGet('${1:var_name}');
\$request->getGet('${1:var_name}');
]]></content>
<tabTrigger>ci_getGet</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_getPost.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$request->getPost('${1:var_name}');
\$request->getPost('${1:var_name}');
]]></content>
<tabTrigger>ci_getPost</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_getServer.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$request->getServer('${1:var_name}');
\$request->getServer('${1:var_name}');
]]></content>
<tabTrigger>ci_getServer</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_getVar.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$request->getVar('${1:var_name}');
\$request->getVar('${1:var_name}');
]]></content>
<tabTrigger>ci_getVar</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_isAjax.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$this->request->isAJAX()
\$this->request->isAJAX()
]]></content>
<tabTrigger>ci_isajax</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_isCLI.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$this->request->isCLI()
\$this->request->isCLI()
]]></content>
<tabTrigger>ci_iscli</tabTrigger>
<scope>source.php</scope>
Expand Down
2 changes: 1 addition & 1 deletion ci4_isSecure.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
\$this->request->isSecure()
\$this->request->isSecure()
]]></content>
<tabTrigger>ci_issecure</tabTrigger>
<scope>source.php</scope>
Expand Down
24 changes: 12 additions & 12 deletions ci4_model.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ use CodeIgniter\Model;
class ${1:${TM_FILENAME/(.+)\..+|.*/\u$1/:NameModel}} extends Model
{
protected \$table = '${1:tableName}';
protected \$primaryKey = '${2:id}';
protected \$table = '${2:tableName}';
protected \$primaryKey = '${3:id}';
protected \$returnType = '${3:array}';
protected \$useSoftDeletes = ${4:true};
protected \$returnType = '${4:array}';
protected \$useSoftDeletes = ${5:true};
protected \$allowedFields = [${5}];
protected \$allowedFields = [${6}];
protected \$useTimestamps = ${6:false};
protected \$createdField = '${7:created_at}';
protected \$updatedField = '${8:updated_at}';
protected \$deletedField = '${9:deleted_at}';
protected \$useTimestamps = ${7:false};
protected \$createdField = '${8:created_at}';
protected \$updatedField = '${9:updated_at}';
protected \$deletedField = '${10:deleted_at}';
protected \$validationRules = [${10}];
protected \$validationMessages = [${11}];
protected \$skipValidation = ${12:false};
protected \$validationRules = [${11}];
protected \$validationMessages = [${12}];
protected \$skipValidation = ${13:false};
}
]]></content>
<tabTrigger>ci_model</tabTrigger>
Expand Down

0 comments on commit de26af4

Please sign in to comment.