allow delegation of block rendering

ref #12

In a template, you can now allow rendering of a block from other bundle.

The layout template must explicitly call the rendering of other block,
with the twig function

```
chill_delegated_block('block_name', { 'array' : 'with context' } )
```

This will launch an event
`Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent` with
the event's name 'chill_block.block_name'.

You may add content to the page using the function
`DelegatedBlockRenderingEvent::addContent`.
This commit is contained in:
2016-03-14 22:33:26 +01:00
parent 42455b7d66
commit 5c67a9098e
3 changed files with 199 additions and 0 deletions

View File

@@ -51,6 +51,13 @@ services:
tags:
- { name: twig.extension }
chill.main.twig.delegated_block:
class: Chill\MainBundle\Templating\DelegatedBlockRenderingTwig
arguments:
- "@event_dispatcher"
tags:
- { name: twig.extension }
chill.main.twig.csv_cell:
class: Chill\MainBundle\Templating\CSVCellTwig
tags: