renus / parameters-editor
Symfony 2 扩展包,用于编辑 parameters.yml symfony 文件
1.2.2
2016-09-27 14:29 UTC
This package is not auto-updated.
Last update: 2024-09-14 19:09:34 UTC
README
Symfony 2 扩展包,用于编辑 parameters.yml symfony 2 或 symfony 3 文件
要在项目中使用 RenusParametersEditorBundle,请通过 composer 添加
安装
安装
- 使用 composer 将此扩展包添加到项目中
composer.phar require renus/parameters-editor:1.0.x-dev
- 注册扩展包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new \Renus\ParametersEditorBundle\RenusParametersEditorBundle(), ); // ... } #configuration ##application twitter first you must create an twitter application on https://apps.twitter.com/ ,and create a token (read permission) ##parameters ### 1.config file you can configure the bundle parameters in app/config/config.yml, the parameters can be added like this : ```yml # app/config/config.yml renus_parameters_editor: all_parameters: false default_keyword: editable
-
all_parameters:这是一个布尔值(默认为 false),当它为 true 时,您可以在 parameters.yml 文件中看到所有参数,否则您只能看到以 "keyword" 前缀的参数(默认:editable,例如:editable.email)。
-
default_keyword:可以编辑的参数的前缀关键字(默认:editable)
2. 路由文件
# app/config/routing.yml renus_parameters_editor: resource: "@RenusParametersEditorBundle/Resources/config/routing.yml" prefix: /administration/config/editor/
您必须使用您的防火墙保护此 URL
#使用方法
##twig 使用
只需在您的 twig 模板中添加此渲染命令即可
{% render(path('renus_parameters_editor_homepage')) %}