micahalsn / codeigniter-tags
CodeIgniter 4框架的标签
v1.1.1
2024-01-05 14:57 UTC
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-09-17 19:13:52 UTC
README
一个库,帮助你在CodeIgniter 4框架中构建围绕现有模型的功能。
安装
composer require michalsn/codeigniter-tags
迁移你的数据库
php spark migrate --all
配置
将HasTags
特质添加到你的模型中,并通过initTags()
方法初始化标签。
class ExampleModel extends BaseModel { use HasTags; // ... protected function initialize() { $this->initTags(); } // ... }
如果你使用实体类,添加TaggableEntity
特质到它
class Example extends Entity { use TaggableEntity; // ... }