Skip to content

Instantly share code, notes, and snippets.

@rande
Created February 24, 2012 01:10
Show Gist options
  • Save rande/1896431 to your computer and use it in GitHub Desktop.
Save rande/1896431 to your computer and use it in GitHub Desktop.
SonataMediaBundle : sonata_media_type template preview
<div>
<form method="POST">
{{ form_widget(form.media.binaryContent, {'attr': {'class': 'span8'}}) }}
{{ form_rest(form) }}
<input type="submit" class="btn" value="Preview Video"/>
</form>
</div>
{% if media and media.providerReference %}
<h2>Preview : {{ media.name }}</h2>
{% media media, 'reference' %}
<p>
The <code>media</code> helper is used to render the video.
</p>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment