2017 © Pedro Peláez
 

library type-jail-bundle

Constraint objects to super types for templating

image

internations/type-jail-bundle

Constraint objects to super types for templating

  • Thursday, December 21, 2017
  • by lstrojny
  • Repository
  • 28 Watchers
  • 0 Stars
  • 2,229 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 88 % Grown

The README.md

Type Jail Bundle

Test, (*1)

Enforce super type contract of an object in a Twig template, (*2)

Installation

Install with composer require internations/type-jail-bundle:*. Add new InterNations\Bundle\TypeJailBundle\InterNationsTypeJailBundle() in your AppKernel.php to load the bundle., (*3)

Configuration

inter_nations_type_jail:
    enabled: # boolean (default: reflects the kernel.debug setting)
    factory: # one of jail, super_type_jail, jail (default: jail)
    types: # A map of type aliases to not use full qualified namespaces in a template
        fileInfo: SplFileInfo

Usage

{% set file = jail(file, 'fileInfo') %}
{% set files = jail_aggregate(files, 'fileInfo') %}

The Versions