https://github.com/michalsn/codeigniter-tags
Tags functionality for Codeigniter 4 framework
https://github.com/michalsn/codeigniter-tags
codeigniter codeigniter4 php php81 tags
Last synced: about 1 month ago
JSON representation
Tags functionality for Codeigniter 4 framework
- Host: GitHub
- URL: https://github.com/michalsn/codeigniter-tags
- Owner: michalsn
- License: mit
- Created: 2023-09-27T16:19:23.000Z (over 1 year ago)
- Default Branch: develop
- Last Pushed: 2024-12-30T07:57:08.000Z (5 months ago)
- Last Synced: 2025-04-11T23:52:38.924Z (about 1 month ago)
- Topics: codeigniter, codeigniter4, php, php81, tags
- Language: PHP
- Homepage: https://michalsn.github.io/codeigniter-tags/
- Size: 587 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeIgniter Tags
A library that helps you build **tags** functionality around your existing models in the CodeIgniter 4 framework.
[](https://github.com/michalsn/codeigniter-tags/actions/workflows/phpunit.yml)
[](https://github.com/michalsn/codeigniter-tags/actions/workflows/phpstan.yml)
[](https://github.com/michalsn/codeigniter-tags/actions/workflows/deptrac.yml)
[](https://coveralls.io/github/michalsn/codeigniter-tags?branch=develop)
## 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.
```php
class ExampleModel extends BaseModel
{
use HasTags;// ...
protected function initialize()
{
$this->initTags();
}// ...
}
```And if you use [Entity](https://www.codeigniter.com/user_guide/models/entities.html) class, add `TaggableEntity` trait to it:
```php
class Example extends Entity
{
use TaggableEntity;// ...
}
```## Docs
https://michalsn.github.io/codeigniter-tags/