michalsn / codeigniter-tags
Tags for CodeIgniter 4 framework
Installs: 3 046
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 2
Open Issues: 2
Requires
- php: ^8.1
- myth/collection: dev-master
Requires (Dev)
- codeigniter4/devkit: ^1.0
- codeigniter4/framework: ^4.1
This package is auto-updated.
Last update: 2024-11-17 19:30:39 UTC
README
A library that helps you build tags functionality around your existing models in the CodeIgniter 4 framework.
Installation
composer require michalsn/codeigniter-tags
Migrate your database:
php spark migrate --all
Configuration
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; // ... }