Skip to content

Bundle for generating paths to sonata media items in twig (and to be able to store them into variables)

Notifications You must be signed in to change notification settings

Filoz/SonataMediaTwigExtensionBundle

Repository files navigation

Installation

  1. Add the repository to the composer.json
#!yaml
...
"repositories": [
    {
      "type": "vcs",
      "url": "git@github.com:SocialbitGmbH/SonataMediaTwigExtensionBundle.git"
    }
  ],
...
  1. Add composer requirement
#!sh
composer require socialbit/sonatamediatwigextension-bundle:~1.0
  1. Add the bundle to the AppKernel
#!php
public function registerBundles()
{
    ...
    new Socialbit\\SonataMediaTwigExtensionBundle\SocialbitSonataMediaTwigExtensionBundle(),
    ...
}
  1. Use the new helper in your twig templates: {% set mediaUrl = media_public_url(media, 'reference') %}

  2. Enjoy

About

Bundle for generating paths to sonata media items in twig (and to be able to store them into variables)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages