mpaleo / view-tags
Simple way to tag your Laravel views
v1.0.0
2016-02-18 21:43 UTC
Requires
- php: >=5.5.9
- illuminate/support: 5.2.*
This package is auto-updated.
Last update: 2024-11-29 04:03:42 UTC
README
Installation
-
Add the package to your composer.json
... "mpaleo/view-tags": "~1.0", ...
-
Update
composer update
-
Add the service provider to the providers array in
{laravel-root}\config\app.php
... ViewTags\ViewTagsServiceProvider::class, ...
-
Add the alias in
{laravel-root}\config\app.php
... 'ViewTags' => ViewTags\ViewTags::class, ...
Usage
Tag views
ViewTags::tag('viewOne', 'someTag'); ViewTags::tag('viewTwo', 'someTag'); ViewTags::tag('viewThree', ['someTag', 'anotherTag']);
Get tagged views
ViewTags::taggedWith('someTag'); /* Output: * array(3) { * [0] => "viewOne" * [1] => "viewTwo" * [2] => "viewThree" * } */ ViewTags::taggedWith('anotherTag'); /* Output: * array(1) { * [0] => "viewThree" * } */
License
The view tags package is licensed under the MIT license