webmakers / symfony-setting-bundle
Bundle for Symfony2 to store site settings in database table
Installs: 45
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.5.0
- symfony/framework-bundle: ~3.0
This package is not auto-updated.
Last update: 2024-11-19 07:15:14 UTC
README
Bundle for Symfony to store the application settings in database table
Installation
Let Composer download and install the bundle by first adding it to your composer.json in your composer.json:
{ "require": { "webmakers/symfony-setting-bundle": "dev-master" } }
and then running
// In shell composer update webmakers/symfony-setting-bundle
Note that once we had a stable version tagged you should use a tagged release instead of the master branch.
Enable the bundle
// in app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Webmakers\SettingBundle\WebmakersSettingBundle(), ); // ... return $bundles; }
Create the table
// In shell php app/console doctrine:schema:update --force
Usage
Controller
$this->get('wm.setting')->getSetting('SETTING_NAME');
Twig
{{ get_setting('SETTING_NAME') }}