stephpy/TimelineBundle — pull request #29 by brentc (2012-11-05 21:44:21+00:00)
Title: Timeline action component rendering

Implements Symfony-Form-like template rendering for timeline action components. Allows timeline_render to provide different output based on component type (subject, verb, direct & indirect compliments) as well as different output based on model class.

This feature should be backwards compatible.

**Thorough explanation of how the feature works is provided in [renderer.markdon](https://github.com/brentc/TimelineBundle/blob/action-component-rendering/Resources/doc/renderer.markdown)**

New [`HighcoTimelineBundle:Default:default.html.twig`](https://github.com/brentc/TimelineBundle/blob/action-component-rendering/Resources/Default/default.html.twig):
```twig
{{ timeline_component_render(timeline,'subject') }}
- {{ timeline_component_render(timeline,'verb') }}
- {{ timeline_component_render(timeline,'direct_complement') }}
```

The new twig function `timeline_component_render()` uses, by default, blocks defined in [`TimelineBundle:Action:component.html.twig`](https://github.com/brentc/TimelineBundle/blob/action-component-rendering/Resources/Action/components.html.twig).

Developers can add their own themes via `config.yml`:
```yaml
highco_timeline:
render:
resources:
- 'AcmeUserBundle:Timeline:components.html.twig'
```

Or via a new twig tag: `timeline_action_theme [timelineAction] [resource file|_self]`

Components can be themed by overriding the standard component blocks (`subject_component`, `verb_component`, etc) or by component-class-name blocks (`_acme_userbundle_entity_user_subject_component`)