Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/internations/type-jail-bundle
Enforce super type contract of an object in a Twig template
https://github.com/internations/type-jail-bundle
Last synced: 9 days ago
JSON representation
Enforce super type contract of an object in a Twig template
- Host: GitHub
- URL: https://github.com/internations/type-jail-bundle
- Owner: InterNations
- Created: 2015-01-15T11:34:34.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-05-26T20:49:50.000Z (over 2 years ago)
- Last Synced: 2024-10-10T22:43:14.849Z (about 1 month ago)
- Language: PHP
- Size: 41 KB
- Stars: 1
- Watchers: 35
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Type Jail Bundle
[![Test](https://github.com/InterNations/type-jail-bundle/actions/workflows/tests.yaml/badge.svg)](https://github.com/InterNations/type-jail-bundle/actions/workflows/tests.yaml)
Enforce super type contract of an object in a Twig template
## Installation
Install with `composer require internations/type-jail-bundle:*`. Add
`new InterNations\Bundle\TypeJailBundle\InterNationsTypeJailBundle()` in your `AppKernel.php` to load the bundle.## 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
```twig
{% set file = jail(file, 'fileInfo') %}
``````twig
{% set files = jail_aggregate(files, 'fileInfo') %}
```