openify/configuration-bundle

A Bundle which allow you to easily store and manage your application configuration

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Installs: 887

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 3

Forks: 3

Open Issues: 3

Type:symfony-bundle

pkg:composer/openify/configuration-bundle

dev-master 2013-09-08 01:25 UTC

This package is not auto-updated.

Last update: 2021-11-20 14:15:21 UTC


README

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') }}