2017 © Pedro Peláez
 

symfony-bundle sensi-yaml-gui-bundle

Simple symfony2 yaml gui which allows you to edit yaml config files in a simple webform.

image

sensi/sensi-yaml-gui-bundle

Simple symfony2 yaml gui which allows you to edit yaml config files in a simple webform.

  • Friday, February 19, 2016
  • by m3byte
  • Repository
  • 1 Watchers
  • 6 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Sensi YAML Gui Bundle

This bundle generates from a given yaml config file, a simple web form in sonata admin dashboard. It's also usable as standalone whitout the SonataAdminBundle., (*1)

The bundle is in an early development version available. So feel free to fork and contribute to the bundle., (*2)

Installation

Using composer:, (*3)

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

Enable the bundle in AppKernel:, (*4)

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

Insert the routing file:, (*5)

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

Create and modify the *app/config/yamlgui.yml and insert it into your app/config.yml:, (*6)

# 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" }

Add yamlgui.yml:, (*7)

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

(Optional) Configure the dashboard block service for Sonata Admin:, (*8)

# app/config/config.yml
sonata_block:
    blocks:
        sonata.block.service.sensi_yaml_gui:
            contexts: [admin]

sonata_admin:
    templates:
        layout: SonataAdminBundle::layout.html.twig
    dashboard:
        blocks:
            -
                position: left
                type: sonata.admin.block.admin_list
            -
                position: right
                type: sonata.block.service.sensi_yaml_gui

Finally create your yml config file and add them under managed_files. After that, the files are editable by calling following path in your browser: /yamlgui/list or /yamlgui/edit/{file_name}, (*9)

Translations

If you wana translate your config key labels to a human readable name you can create a translation file in app/Resources/translations/sensi_yaml_gui..yml. This file can extends the original translation file with your custom translations., (*10)

The Versions

19/02 2016

dev-master

9999999-dev http://www.m3byte.com

Simple symfony2 yaml gui which allows you to edit yaml config files in a simple webform.

  Sources   Download

MIT

The Requires

 

yaml gui sensi sonata-admin extension