Added TweetExtension
This commit is contained in:
parent
ad6a00b003
commit
1ed53d7357
|
@ -26,11 +26,8 @@ tweets: yes
|
|||
{% endblock %}
|
||||
|
||||
{% block feedback %}
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a></p>— CURVE (@CurveAgency) <a href="https://twitter.com/CurveAgency/status/440095250775035904">March 2, 2014</a></blockquote>
|
||||
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Great presentation by <a href="https://twitter.com/opdavies">@opdavies</a> on git flow at <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> very well prepared and presented. <a href="http://t.co/tDINp2Nsbn">pic.twitter.com/tDINp2Nsbn</a></p>— Greg Franklin (@gfranklin) <a href="https://twitter.com/gfranklin/status/440104311276969984">March 2, 2014</a></blockquote>
|
||||
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> Thanks for the talk today on git flow. Looking forward to use it. <a href="https://twitter.com/hashtag/drupalcampldn?src=hash">#drupalcampldn</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> <a href="https://twitter.com/hashtag/git?src=hash">#git</a></p>— Drupal Cafe UK (@drupal_cafe) <a href="https://twitter.com/drupal_cafe/status/440119608939278338">March 2, 2014</a></blockquote>
|
||||
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/DrupalCampLDN">@DrupalCampLDN</a> always had trouble with git. Your talk + Git flow has made it all very easy.</p>— James Tombs (@jtombs) <a href="https://twitter.com/jtombs/status/440108072078696449">March 2, 2014</a></blockquote>
|
||||
{{ tweet('Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a></p>— CURVE (@CurveAgency) <a href="https://twitter.com/CurveAgency/status/440095250775035904">March 2, 2014</a>')|raw }}
|
||||
{{ tweet('Great presentation by <a href="https://twitter.com/opdavies">@opdavies</a> on git flow at <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> very well prepared and presented. <a href="http://t.co/tDINp2Nsbn">pic.twitter.com/tDINp2Nsbn</a></p>— Greg Franklin (@gfranklin) <a href="https://twitter.com/gfranklin/status/440104311276969984">March 2, 2014</a>')|raw }}
|
||||
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> Thanks for the talk today on git flow. Looking forward to use it. <a href="https://twitter.com/hashtag/drupalcampldn?src=hash">#drupalcampldn</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> <a href="https://twitter.com/hashtag/git?src=hash">#git</a></p>— Drupal Cafe UK (@drupal_cafe) <a href="https://twitter.com/drupal_cafe/status/440119608939278338">March 2, 2014</a>')|raw }}
|
||||
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/DrupalCampLDN">@DrupalCampLDN</a> always had trouble with git. Your talk + Git flow has made it all very easy.</p>— James Tombs (@jtombs) <a href="https://twitter.com/jtombs/status/440108072078696449">March 2, 2014</a>')|raw }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -31,5 +31,5 @@ I categorised the technical changes into groups for site builders, developers an
|
|||
{% endblock %}
|
||||
|
||||
{% block feedback %}
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Cool to hear how much new stuff is in <a href="https://twitter.com/drupal">@drupal</a> 8. Integrating with more third party code rather than rolling their own. <a href="https://twitter.com/hashtag/phpsw?src=hash">#phpsw</a></p>— Tom Robertshaw (@bobbyshaw) <a href="https://twitter.com/bobbyshaw/status/585882859631706114">April 8, 2015</a></blockquote>
|
||||
{{ tweet('Cool to hear how much new stuff is in <a href="https://twitter.com/drupal">@drupal</a> 8. Integrating with more third party code rather than rolling their own. <a href="https://twitter.com/hashtag/phpsw?src=hash">#phpsw</a></p>— Tom Robertshaw (@bobbyshaw) <a href="https://twitter.com/bobbyshaw/status/585882859631706114">April 8, 2015</a>')|raw }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -27,5 +27,5 @@ This session covered how to install Sculpin itself, as well as how to use it to
|
|||
{% endblock %}
|
||||
|
||||
{% block feedback %}
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Twig said 'foo', then Sculpin said 'bar'. They agreed to go spaceless ;-) Interesting talk by <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/hashtag/dcnorth15?src=hash">#dcnorth15</a> <a href="http://t.co/26GmhiCdfJ">http://t.co/26GmhiCdfJ</a></p>— Stefan van Hooft (@hooftio) <a href="https://twitter.com/hooftio/status/624898550158200832">July 25, 2015</a></blockquote>
|
||||
{{ tweet('Twig said 'foo', then Sculpin said 'bar'. They agreed to go spaceless ;-) Interesting talk by <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/hashtag/dcnorth15?src=hash">#dcnorth15</a> <a href="http://t.co/26GmhiCdfJ">http://t.co/26GmhiCdfJ</a></p>— Stefan van Hooft (@hooftio) <a href="https://twitter.com/hooftio/status/624898550158200832">July 25, 2015</a>')|raw }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -34,5 +34,5 @@ In each point, tried to cover the differences between Drupal core and developing
|
|||
{% endblock %}
|
||||
|
||||
{% block feedback %}
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/Horls">@Horls</a> <a href="https://twitter.com/mhwelander">@mhwelander</a> <a href="https://twitter.com/ThisisZone">@ThisisZone</a> <a href="https://twitter.com/mozzy16">@mozzy16</a> Thanks for a top night of knowledge sharing! <a href="https://twitter.com/hashtag/drupal?src=hash">#drupal</a> <a href="https://twitter.com/hashtag/episerver?src=hash">#episerver</a> <a href="https://twitter.com/hashtag/sitecore?src=hash">#sitecore</a> <a href="https://twitter.com/hashtag/umbraco?src=hash">#umbraco</a> <a href="https://twitter.com/hashtag/h5yr?src=hash">#h5yr</a></p>— umBristol (@umBristol) <a href="https://twitter.com/umBristol/status/636290498362216449">August 25, 2015</a></blockquote>
|
||||
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/Horls">@Horls</a> <a href="https://twitter.com/mhwelander">@mhwelander</a> <a href="https://twitter.com/ThisisZone">@ThisisZone</a> <a href="https://twitter.com/mozzy16">@mozzy16</a> Thanks for a top night of knowledge sharing! <a href="https://twitter.com/hashtag/drupal?src=hash">#drupal</a> <a href="https://twitter.com/hashtag/episerver?src=hash">#episerver</a> <a href="https://twitter.com/hashtag/sitecore?src=hash">#sitecore</a> <a href="https://twitter.com/hashtag/umbraco?src=hash">#umbraco</a> <a href="https://twitter.com/hashtag/h5yr?src=hash">#h5yr</a></p>— umBristol (@umBristol) <a href="https://twitter.com/umBristol/status/636290498362216449">August 25, 2015</a>')|raw }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -32,5 +32,5 @@ You can [view the full slides](/slides/phpsw/building-static-websites-with-sculp
|
|||
{% endblock %}
|
||||
|
||||
{% block feedback %}
|
||||
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Simple and very cool use of video in <a href="https://twitter.com/opdavies">@opdavies</a> lightning talk <a href="https://twitter.com/phpsw">@phpsw</a> to show how to do things</p>— Stuart Herbert (@stuherbert) <a href="https://twitter.com/stuherbert/status/654367259339661312">October 14, 2015</a></blockquote>
|
||||
{{ tweet('Simple and very cool use of video in <a href="https://twitter.com/opdavies">@opdavies</a> lightning talk <a href="https://twitter.com/phpsw">@phpsw</a> to show how to do things</p>— Stuart Herbert (@stuherbert) <a href="https://twitter.com/stuherbert/status/654367259339661312">October 14, 2015</a>')|raw }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -47,7 +47,7 @@ What we won’t be covering:
|
|||
{% endblock %}
|
||||
|
||||
{% block feedback %}
|
||||
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> good talk on Getting started with Drupal 8 module development! 😀</p>— Michael trestianu (@Tresti88) <a href="https://twitter.com/Tresti88/status/706129843134570496">March 5, 2016</a></blockquote>
|
||||
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> Great talk. Thanks.</p>— John Bloomfield (@jbloomfield) <a href="https://twitter.com/jbloomfield/status/706131469148811264">March 5, 2016</a></blockquote>
|
||||
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> definitely went well , I learnt from it , as did a others .</p>— tim marsh (@timmarsh) <a href="https://twitter.com/timmarsh/status/706214342027567104">March 5, 2016</a></blockquote>
|
||||
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> good talk on Getting started with Drupal 8 module development! 😀</p>— Michael trestianu (@Tresti88) <a href="https://twitter.com/Tresti88/status/706129843134570496">March 5, 2016</a>')|raw }}
|
||||
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> Great talk. Thanks.</p>— John Bloomfield (@jbloomfield) <a href="https://twitter.com/jbloomfield/status/706131469148811264">March 5, 2016</a>')|raw }}
|
||||
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> definitely went well , I learnt from it , as did a others .</p>— tim marsh (@timmarsh) <a href="https://twitter.com/timmarsh/status/706214342027567104">March 5, 2016</a>')|raw }}
|
||||
{% endblock %}
|
||||
|
|
44
src/AppBundle/Twig/TweetExtension.php
Normal file
44
src/AppBundle/Twig/TweetExtension.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace AppBundle\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
class TweetExtension extends Twig_Extension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new Twig_SimpleFunction('tweet', [$this, 'render']),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a tweet.
|
||||
*
|
||||
* @param string $tweet
|
||||
* The content of the tweet.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render($tweet)
|
||||
{
|
||||
return sprintf(
|
||||
'<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">%s</blockquote>',
|
||||
$tweet
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'tweet';
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,10 @@ services:
|
|||
class: AppBundle\Twig\SpeakerDeckExtension
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
app.twig.tweet:
|
||||
class: AppBundle\Twig\TweetExtension
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
app.twig.vimeo:
|
||||
class: AppBundle\Twig\VimeoExtension
|
||||
tags:
|
||||
|
|
Reference in a new issue