A bundle which allow you to easily store you application configuration
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
DependencyInjection
Entity
Exception
Resources/config
Subscriber
Tests/Controller
Twig
.gitignore
OpenifyConfigurationBundle.php
README.md
composer.json

README.md

ConfigurationBundle

A bundle which allow you to easily store you application configuration.

#Install

composer.json

{
    "require": {
        "openify/configuration-bundle": "dev-master"
    },
}

app/appKernel.php

        $bundles = array(
            // [...]
            Openify\Bundle\ConfigurationBundle\OpenifyConfigurationBundle(),
        );

app/config/config.yml

Custom table prefix:

parameters:
    openify.configuration.table_prefix:  page_

#Usage

  1. In a controller

    $sitename = $this->container->get('openify.configuration')->get('site_name', 'default_value');
  2. In a view

    {{ openify_configuration.get('site_name', 'default_value') }}
  3. Use with namespace

    $sitename = $this->container->get('openify.configuration')->get('site_name', 'default_value', 'namespace');
    {{ openify_configuration.get('site_name', 'default_value', 'namespace') }}