2017 © Pedro Peláez
 

library eddie-jaoude-symfony-translation-twig-collection-bundle

Symfony Translation Bundle for Twig Extension to handle collection

image

eddiejaoude/eddie-jaoude-symfony-translation-twig-collection-bundle

Symfony Translation Bundle for Twig Extension to handle collection

  • Saturday, April 4, 2015
  • by eddiejaoude
  • Repository
  • 1 Watchers
  • 13 Stars
  • 1,272 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Symfony Translation Twig Collection Bundle

Symfony Translation Bundle for Twig Extension to handle collection, (*2)

Version Branch Latest Release
Symfony 2.2+ 2.2 v2.2.0
Symfony 2.6+ 2.6 v2.6.0

Installation

  1. Composer
   "require": {
       "eddiejaoude/eddie-jaoude-symfony-translation-twig-collection-bundle": "dev-master"
   }
  1. Run update
php composer.phar update
  1. Add to AppKernel
   $bundles = array(
   // ...
   new EddieJaoude\Bundle\SymfonyTranslationTwigCollectionBundle\EddieJaoudeSymfonyTranslationTwigCollectionBundle(),
   // ...
   )

Usage

Translation file (eg. messages.en.yml), (*3)

termsAndConditions:
  title: Terms and Conditions
  paragraph:
    - Terms Information 1
    - Terms Information 2
    - Terms Information 3
    - Terms Information 4
    ...

Twig template (eg. index.html.twig), (*4)

{% for i in range(0,'termsAndConditions.paragraph'|translationLength) -%}
    <p>{{('termsAndConditions.paragraph.'~i)|trans}}</p>
{%- endfor %}

Output, (*5)

Terms Information 1
Terms Information 2
Terms Information 3
Terms Information 4

Credits

Inspired by acontell http://stackoverflow.com/questions/27868921/symfony2-translation-yaml-array-and-twig-loop, (*6)

The Versions

04/04 2015

2.6.x-dev

2.6.9999999.9999999-dev

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires

01/03 2015

2.2.x-dev

2.2.9999999.9999999-dev

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires

01/03 2015

dev-master

9999999-dev

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires

01/03 2015

2.2.0

2.2.0.0

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires

11/01 2015

0.1.0

0.1.0.0

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires

11/01 2015

0.1.1

0.1.1.0

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires

11/01 2015

2.6.0

2.6.0.0

Symfony Translation Bundle for Twig Extension to handle collection

  Sources   Download

MIT

The Requires

 

The Development Requires