buibr/yii2-dynamic-settings
Composer 安装命令:
composer require buibr/yii2-dynamic-settings
包简介
Dynamic setting management with database table.
README 文档
README
Description
Dynamic setting management with database table.
Installation
composer require buibr/yii2-dynamic-settings
yii migrate --migrationPath=vendor/buibr/yii2-dynamic-settings/migrations/
Usage
Extend settings with new clase.
class Crm extends \buibr\yii2settings\Settings
{
/**
* Set the group of settings.
*/
public static function group()
{
return "crm";
}
/**
* The default setting for begining on new installation.
*/
public static function defaults()
{
return [
[
'name' =>'default_vat',
'value' => 0,
'text' => 'What is the autoselected VAT ',
'type' => self::TYPE_SELECT,
'source' => self::SOURCE_CLASS,
'source_data' => '\app\models\VatGroups'
],
[
'name' => 'invoicing_date',
'value' => 3,
'text' => 'In which day of the month we will generate invoices for clients.',
'type' => self::TYPE_TEXT,
],
];
}
}
call like:
foreach(Crm::all() as $sett) {
$sett->render();
}
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-03