PHP Classes

Easy PHP Config Bundle: Application configuration management using forms

Recommend this page to a friend!
  Info   View files Documentation   View files View files (30)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-08-13 (9 months ago) RSS 2.0 feedNot enough user ratingsTotal: 61 All time: 10,454 This week: 69Up
Version License PHP version Categories
easyconfigbundle 1.0The PHP License7HTML, Libraries, Configuration, PHP 7
Description 

Authors

Mamun Ahmed
EasyConfigBundle Community


Contributor

This package can be used to implement application configuration management using forms.

It provides a bundle for the Symfony framework that provides model classes to define configurations specific to each application.

The application can also generate form groups based on the configuration definition to let application users edit the configuration values on a Web page with a form.

Innovation Award
PHP Programming Innovation award nominee
August 2023
Number 6
A significant part of the mature applications have configurations that the application users can edit.

Usually, developers store the configuration values for each user in some container, for instance, database tables. Then they develop a user interface to let users edit their configuration values.

This package provides an alternative solution that lets the application developer create model classes for each configuration they want to let the users edit.

Then the application can generate form groups that can be added to a form to let the users edit the configuration values on a Web page.

This way, developers can spend less time implementing Web forms to let users edit their application configuration settings.

Manuel Lemos
Picture of Roni
  Performance   Level  
Name: Roni is available for providing paid consulting. Contact Roni .
Classes: 12 packages by
Country: Bangladesh Bangladesh
Age: ???
All time rank: 279535 in Bangladesh Bangladesh
Week rank: 307 Up6 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 6x

Documentation

Easy Config Bundle

A Symfony Bundle for easy configuration management.

Features Include

  • Group wise dynamic form creation ability
  • Store global configuration
  • Store user wise configuration
  • Get configuration through rest API

Install

  1. Download and Enable EasyConfigBundle
  2. Register an Interface to Kernel file
  3. Create Config entity class
  4. Configure yaml file
  5. Update database schema
  6. Create your first form
  7. Register the bundle?s routes
  8. Overriding default EasyConfigBundle templates (optional)

1. Download and Enable EasyConfigBundle :

_Download through composer :_

Open a command console, enter project directory and execute the following command to download the latest stable version of this bundle:

$ composer require xiidea/easy-config
_Enable Bundle (No need when Flex is available):_

The bundle should be automatically enabled by Symfony Flex. If you don't use Flex, you will need to enable the bundle manually by adding the following line in the config/bundles.php file of your project:

<?php
// src/Kernel.php

return [
    // ...
    Xiidea\EasyConfigBundle\XiideaEasyConfigBundle::class => ['all' => true],
];

2. Register an Interface to Kernel file

Open application Kernel.php File and add below code inside the build method of this file

<?php
// src/Kernel.php

public function build(ContainerBuilder $container)
{
    // ...
    $container->registerForAutoconfiguration(ConfigGroupInterface::class)
	   ->addTag('xiidea.easy_config.group');
}

_Note: Do not forget to include the below line above in your src/Kernel.php_

use Xiidea\EasyConfigBundle\Services\FormGroup\ConfigGroupInterface;

3. Create Config entity class:

By default EasyConfigBundle supports Doctrine ORM. However, you must provide an Entity class and the class has to extend the class \Xiidea\EasyConfigBundle\Model\BaseConfig. To configure the Entity class properly please follow the detailed instructions.

4. Configure yaml file:

Create a file in the following directory config/packages with the exact name xiidea_easy_config.yaml A sample config file is available in this path Resources/config/config-sample.yml. Copy this sample file's content and paste to just created file. Do not forget to change your Entity class name which has been mentioned in Step 3.

# Xiidea Easy Config Configuration Sample

xiidea_easy_config:
    config_class: App\Entity\Configuration

5. Update database schema:

It?s time to set up the database schema, open your command console, go to your project root path and execute the following command.

$ php bin/console doctrine:schema:update --force

6. Create form group and type:

Create a form group class and form type with your necessary fields. Please follow the instructions to create the form group and type.

7. Register the bundle?s routes:

Now it's time to access the form you have just created, for that you have to include bundle's routes to your application by the following way.

xiidea_config_route:
    resource: "@XiideaEasyConfigBundle/Resources/config/routes.yaml"
    prefix: '/config'

_Note: You may change the prefix as your wish_

Following routes are available in this bundle: * Index route (prefix/) : List of all forms * Form group route (prefix/group_key) : Form of specific group key

8. Overriding default EasyConfigBundle templates (optional)

Template overriding is not important to use EasyConfigBundle bundle but if you want to keep UI as similar as your application you can override the template, to do so follow the instructions

Congratulations !

Your application is ready to store configurations, just browse the routes.

License

The Easy Config Bundle is licensed under the MIT license. See the LICENSE file for more details.


  Files folder image Files  
File Role Description
Files folder imageController (2 files)
Files folder imageDependencyInjection (2 files, 1 directory)
Files folder imageException (2 files)
Files folder imageModel (2 files)
Files folder imageResources (4 directories)
Files folder imageServices (3 directories)
Files folder imageUtility (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me
Plain text file XiideaEasyConfigBundle.php Class Class source

  Files folder image Files  /  Controller  
File Role Description
  Plain text file ConfigApiController.php Class Class source
  Plain text file ConfigCrudController.php Class Class source

  Files folder image Files  /  DependencyInjection  
File Role Description
Files folder imageCompiler (1 file)
  Plain text file Configuration.php Class Class source
  Plain text file XiideaEasyConfigExtension.php Class Class source

  Files folder image Files  /  DependencyInjection  /  Compiler  
File Role Description
  Plain text file ConfigGroupCompilerPass.php Class Class source

  Files folder image Files  /  Exception  
File Role Description
  Plain text file FormValidationException.php Class Class source
  Plain text file UnrecognizedEntityException.php Class Class source

  Files folder image Files  /  Model  
File Role Description
  Plain text file BaseConfig.php Class Class source
  Plain text file BaseConfigInterface.php Class Class source

  Files folder image Files  /  Resources  
File Role Description
Files folder imageconfig (3 files)
Files folder imagedoc (3 files)
Files folder imagepublic (1 directory)
Files folder imageviews (4 files)

  Files folder image Files  /  Resources  /  config  
File Role Description
  Accessible without login Plain text file config_sample.yaml Data Auxiliary data
  Accessible without login Plain text file routes.yaml Data Auxiliary data
  Accessible without login Plain text file services.yaml Data Auxiliary data

  Files folder image Files  /  Resources  /  doc  
File Role Description
  Plain text file config-entity.md Class Class source
  Plain text file form-group-and-type.md Class Class source
  Accessible without login Plain text file overriding_templates.md Data Auxiliary data

  Files folder image Files  /  Resources  /  public  
File Role Description
Files folder imagejs (1 file)

  Files folder image Files  /  Resources  /  public  /  js  
File Role Description
  Accessible without login Plain text file easyconfig.js Data Auxiliary data

  Files folder image Files  /  Resources  /  views  
File Role Description
  Accessible without login Plain text file index.html.twig Data Auxiliary data
  Accessible without login Plain text file layout.html.twig Data Auxiliary data
  Accessible without login Plain text file list.html.twig Data Auxiliary data
  Accessible without login Plain text file user.html.twig Data Auxiliary data

  Files folder image Files  /  Services  
File Role Description
Files folder imageFormGroup (2 files)
Files folder imageManager (1 file)
Files folder imageRepository (2 files)

  Files folder image Files  /  Services  /  FormGroup  
File Role Description
  Plain text file BaseConfigGroup.php Class Class source
  Plain text file ConfigGroupInterface.php Class Class source

  Files folder image Files  /  Services  /  Manager  
File Role Description
  Plain text file ConfigManager.php Class Class source

  Files folder image Files  /  Services  /  Repository  
File Role Description
  Plain text file ConfigRepository.php Class Class source
  Plain text file ConfigRepositoryInterface.php Class Class source

  Files folder image Files  /  Utility  
File Role Description
  Plain text file StringUtil.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:61
This week:0
All time:10,454
This week:69Up