andrylik/yii2-settings 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andrylik/yii2-settings

最新稳定版本:0.2.0

Composer 安装命令:

composer require andrylik/yii2-settings

包简介

Settings Manager for Yii2 with the possibility of translating values.

README 文档

README

Yii2 Settings Extension


Settings Manager for Yii2 with the possibility of translating values.

Installation

Via Composer.

php composer.phar require --prefer-dist andrylik/yii2-settings "*"

Database Migrations

Before usage this extension, we'll also need to prepare the database.

php yii migrate --migrationPath=@vendor/andrylik/yii2-settings/migrations

Configuration

Module Setup

Configure "Yii2 Settings Extension" module in backend/config/main.php:

'modules' => [
    'settings' => [
        'class' => 'andrylik\settings\Module',
    ],
],

If you need to translate the values to other languages

add parameters in common/config/params.php

return [
    // ...
    'languages' => ['uk', 'ru', 'en'], //languages to translate
    'defaultLanguage' => 'uk' //default app language
];

Also specify the language of the application common/config/main.php

return [
    // ...
    'language' => 'uk',
    //..
];

Component Setup

Configure Settings Component common/config/main.php

'components' => [
    'cache' => [
        'class' => \yii\caching\FileCache::class,
        'cachePath' => '@frontend/runtime/cache'
    ],
    'settings' => [
        'class' => 'andrylik\settings\components\Settings',
    ],
],

Usage:

Go to http://backend.yourdomain.com/settings/default/index for managing your settings

Add a setting, for example, like this

Section: site

Key: default_title

Value: my super website

Description: default site title

Use the settings in your application

$settings = Yii::$app->settings;

$title = $settings->get('site', 'default_title');

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固