bupychuk/sensi-yaml-gui-bundle

这是一个简单的symfony2 yaml gui,允许您通过简单的网页表单编辑yaml配置文件。

安装: 110

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 7

类型:symfony-bundle

dev-master / 1.0.x-dev 2016-08-30 13:33 UTC

This package is not auto-updated.

Last update: 2024-09-18 18:34:54 UTC


README

此捆绑包可以从给定的yaml配置文件生成一个简单的网页表单,位于sonata管理仪表板中。它也可以独立使用,无需SonataAdminBundle。

该捆绑包处于早期开发版本。因此,请随意fork并向捆绑包贡献。

安装

使用composer

$ php composer.phar require sensi/sensi-yaml-gui-bundle

在AppKernel中启用捆绑包

// app/AppKernel.php
public function registerBundles()
{
    return array(
    // ...
    new Sensi\Bundle\YamlGuiBundle\SensiYamlGuiBundle(),
    // ...
    );
}

插入路由文件

# app/config/routing.yml
sensi_yaml_gui:
    resource: "@SensiYamlGuiBundle/Resources/config/routing.yml"
    prefix:   /yamlgui

创建并修改 *app/config/yamlgui.yml 并将其插入到您的 app/config.yml 中

# app/config/yamlgui.yml
sensi_yaml_gui:
	# Includes the sonata admin pool into the yaml gui (use sonata base template). 
	# Default value false.
	sonata_admin_modus: true

	# Path where the managed yaml config files were located
	# Notice you have to create the folder and make it writeable for the yamlgui writer
	config_root_dir: "%kernel.root_dir%/config/yamlgui/"   

	# List of all files which were available throw the yamlgui. Must be located in 
	# config_root_dir
	managed_files:
	  "demo.yml": { title: "Demo config" }

添加yamlgui.yml

# app/config/config.yml 
- { resource: yamlgui.yml }

最后,创建您的yml配置文件,并将它们添加到 managed_files 下。之后,您可以通过在浏览器中调用以下路径来编辑这些文件:/yamlgui/list 或 /yamlgui/edit/{文件名}

翻译

如果您想将配置键标签翻译成人类可读的名称,您可以在 app/Resources/translations/sensi_yaml_gui.<language_key>.yml 中创建一个翻译文件。此文件可以扩展原始翻译文件以包含您的自定义翻译。