Skip to content

Instantly share code, notes, and snippets.

@AmauryCarrade
Created July 10, 2012 23:27
Show Gist options
  • Save AmauryCarrade/3086908 to your computer and use it in GitHub Desktop.
Save AmauryCarrade/3086908 to your computer and use it in GitHub Desktop.
{# ZmCardBundle:Card:card.html.twig #}
{% extends 'ZmCardBundle::layout.html.twig' %}
{% block content %}
{# ... #}
{{ card|raw }}
{# ... #}
{% endblock %}
<?php
# In a controller
$cardTemplateID = // Some logic to get this identifier
$infos = // Idem for user infos
$links = // Idem for links
$HTMLCard = $this->renderView('ZmCardStorageBundle:Cards:' . $cardTemplateID . '.html.twig', array(
'infos' => $infos,
'links' => $links
));
return $this->render('ZmCardBundle:Card:card.html.twig', array(
'card' => $HTMLCard,
// ...
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment