yiicod/systemparam

该包已被废弃且不再维护。作者建议使用 yiicod/yii2-systemparams 包代替。

在管理面板中编辑配置参数,适用于 Yii 框架

安装: 19

依赖者: 0

建议者: 0

安全: 0

类型:yii-extension

0.2.1 2016-04-05 10:01 UTC

This package is auto-updated.

Last update: 2022-02-01 12:48:06 UTC


README

使用此扩展,您可以从管理面板轻松配置 Yii::app()->params。您需要使用 composer 安装扩展并运行以下命令

php yiic params sync

这是同步您的 php 配置与数据库的命令。

通过 composer 安装此扩展是首选方式。

可以运行以下命令:

php composer.phar require --prefer-dist yiicod/systemparam "*"

或者添加

"yiicod/systemparam": "*"

源代码链接: https://bitbucket.org/yiicod/systemparam

配置(这是所有扩展的配置)

aliases' => array(
	'vendor' => 'application.vendor',
	'editable' => 'vendor.vitalets.x-editable-yii',
),
'import' => array(
        'editable.*',
),
'components' => array(
    ...
    'editable' => [
	'class' => 'editable.EditableConfig',
	    'form' => 'jqueryui',
	    'mode' => 'inline',
	    'defaults' => [
		'emptytext' => 'Click to edit',
		'ajaxOptions' => ['dataType' => 'json'], //usefull for json exchange with server
	],
    ],
    'systemparam' => array(
        'class' => 'yiicod\systemparam\SystemParam',
        'modelMap' => array(
            'SystemParam' => array(
                'alias' => 'yiicod\systemparam\models\SystemParamModel',
                'class' => 'yiicod\systemparam\models\SystemParamModel',
                'fieldParamKey' => 'paramKey',
                'fieldParamValue' => 'paramValue',
                'fieldValidator' => 'validator',
                'fieldDescription' => 'description',
                'fieldIsDefault' => 'isDefault',
            )
        ),
        'autoUpdate' => YII_DEBUG,
        'debug' => YII_DEBUG,
        'controllers' => array(
            'controllerMap' => array(
                'admin' => array(
                    'systemParam' => 'yiicod\systemparam\controllers\admin\ParamController',
                )
            ),
            'admin' => array(
                'systemParam' => array(
                    'layout' => '/layouts/column1',
                    'filters' => array('accessControl'),
                    'accessRules' => array(
                        array('allow',
                            'actions' => array('update', 'admin'),
                            'roles' => array('admin'),
                        ),
                        array('deny', // deny all users
                            'users' => array('*'),
                        ),
                    ),
                )
            ),
        ),
        'components' => array(),
    ),
    ...
)

'preload' => array('systemparam')

应该可以与不同的 urlManager 配置一起工作,但尚未在不同 url 规则上测试。