2017 © Pedro Peláez
 

symfony-bundle vars-bundle

Symfony2 bundle dynamic parameters

image

zent/vars-bundle

Symfony2 bundle dynamic parameters

  • Wednesday, August 2, 2017
  • by zen1t
  • Repository
  • 1 Watchers
  • 0 Stars
  • 500 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

SensioLabsInsight, (*1)

Step 1: Download ZentVarsBundle using composer

composer require zent/vars-bundle dev-master, (*2)

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*3)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Zent\VarsBundle\ZentVarsBundle(),
        // ...
    );
}
Step 3: Create your Vars class
// src/AppBundle/Entity/Vars.php
use Zent\VarsBundle\Entity\BaseVars;

class Vars extended BaseVars
{
}
Step 4: Configure the ZentVarsBundle
# app/config/config.yml
zent_vars:
    class: AppBunde\Entity\Vars

If you need additional caching:, (*4)

doctrine_cache:
    providers:
        zent_vars_query_cache:
            type: apc
            namespace: query_cache_ns
            alias:
              - zent_vars.cache

Doc: https://symfony.com/doc/current/bundles/DoctrineCacheBundle/reference.html, (*5)

Step 5: Update your database schema

Usage

Accessing the User Manager service
$varsManager = $container->get('zent_vars.manager');
$var = $varsManager->getValue('first');
$var = $varsManager->getValue('first', 10); //return '10' if var not found 
Twig
{{ vars('first') }}

Command Line Tools

php app/console zent:vars:create email_owner test@example.com "Email владельца"
php app/console zent:vars:update email_owner test@test.com
php app/console zent:vars:delete email_owner
php app/console zent:vars:list

The Versions

02/08 2017

dev-master

9999999-dev

Symfony2 bundle dynamic parameters

  Sources   Download

MIT

The Requires

 

by Larshin Andrey

bundle symfony parameters vars

16/07 2017

v0.2

0.2.0.0

Symfony2 bundle dynamic parameters

  Sources   Download

MIT

The Requires

 

by Larshin Andrey

bundle symfony parameters vars

17/02 2017

v0.1

0.1.0.0

Symfony2 bundle dynamic parameters

  Sources   Download

MIT

The Requires

 

by Larshin Andrey

bundle symfony parameters vars