2017 © Pedro Peláez
 

symfony-bundle oembed-bundle

Bundle with a way of defining oEmbed providers, and rendering oEmbed in templates.

image

markup/oembed-bundle

Bundle with a way of defining oEmbed providers, and rendering oEmbed in templates.

  • Wednesday, June 6, 2018
  • by shieldo
  • Repository
  • 2 Watchers
  • 4 Stars
  • 33,264 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 13 % Grown

The README.md

MarkupOEmbedBundle

Build Status, (*1)

Installation

You can install this bundle using composer or add the package to your composer.json file directly., (*2)

   composer require markup/oembed-bundle

After you have installed the package, you just need to add the bundle to your AppKernel.php file:, (*3)

   // in AppKernel::registerBundles()
   $bundles = array(
       // ...
       new Markup\OEmbedBundle\MarkupOEmbedBundle(),
       // ...
   );

About

This Symfony2 bundle offers the ability to easily define integrations with OEmbed providers on an ad-hoc basis without needing to make use of a service like Embed.ly., (*4)

Usage

Say you want to include Youtube videos using OEmbed - you can set up a provider as semantic configuration in your config.yml file:, (*5)

    markup_o_embed:
        providers:
            youtube:
                endpoint: http://www.youtube.com/oembed
                scheme: "http://www.youtube.com/watch?v=$ID$"
                code_property: html

You can then render oEmbed blocks in a template either by referencing the media ID and provider inline:, (*6)

    {{ markup_oembed('dQw4w9WgXcQ', 'youtube', {}) }}

or if you have passed an object of class Markup\OEmbedBundle\OEmbed\Reference into your template:, (*7)

    use Markup\OEmbedBundle\OEmbed\Reference;

    $oEmbed = new Reference('dQw4w9WgXcQ', 'youtube');
    $twig->render('my_template.html.twig', array('oembed' => $oEmbed));

you can then reference it slightly differently:, (*8)

    {{ markup_oembed_render(oembed, {}) }}

License

Released under the MIT License. See LICENSE., (*9)

The Versions

06/06 2018

dev-master

9999999-dev

Bundle with a way of defining oEmbed providers, and rendering oEmbed in templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

media oembed

19/02 2018

dev-test_against_php_7_2

dev-test_against_php_7_2

Bundle with a way of defining oEmbed providers, and rendering oEmbed in templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

media oembed

21/08 2017

1.0.1

1.0.1.0

Bundle with a way of defining oEmbed providers, and rendering oEmbed in templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

media oembed

19/07 2017

1.0.0

1.0.0.0

Bundle with a way of defining oEmbed providers, and rendering oEmbed in templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

media oembed