Tags functionality for Codeigniter 4 framework
MIT License
A library that helps you build tags functionality around your existing models in the CodeIgniter 4 framework.
composer require michalsn/codeigniter-tags
Migrate your database:
php spark migrate --all
Add HasTags
trait to your model and initialize tags with initTags()
method.
class ExampleModel extends BaseModel
{
use HasTags;
// ...
protected function initialize()
{
$this->initTags();
}
// ...
}
And if you use Entity class, add TaggableEntity
trait to it:
class Example extends Entity
{
use TaggableEntity;
// ...
}