xiidea / easy-config
A Symfony Bundle for easy configuration management
Installs: 81
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0
- doctrine/dbal: ^3.2|^4.0
- doctrine/orm: ^2.4|^3.0
- symfony/form: >=5.0 <7.0.0
- symfony/framework-bundle: >=5.0 <7.0.0
- symfony/http-foundation: >=5.0 <7.0.0
- symfony/security-bundle: >=5.0 <7.0.0
- symfony/security-core: >=5.0 <7.0.0
- symfony/twig-bundle: >=5.0 <7.0.0
Requires (Dev)
- symfony/test-pack: ^1.1
- dev-main
- 0.0.1
- dev-bugfix/configuration-group-not-inject
- dev-bugfix/exception-identifier-null-value
- dev-feature/orm-dependency
- dev-bugfix/twig-bundle-not-found
- dev-bugfix/deprecations-sf6
- dev-bugfix/constructor-param-missing
- dev-feature/change-github-actions
- dev-feature/unit-test-case
- dev-bugfix/patch-1
- dev-saifulferoz-patch-1-1
- dev-saifulferoz-patch-1
This package is auto-updated.
Last update: 2024-12-25 09:35:44 UTC
README
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
- Download and Enable EasyConfigBundle
- Create Config entity class
- Configure yaml file
- Update database schema
- Create your first form
- Register the bundle’s routes
- 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. 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.
3. 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
4. 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
5. 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.
6. 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
7. 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.