• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Twigエクステンションの作り方
 

Twigエクステンションの作り方

on

  • 6,523 views

 

Statistics

Views

Total Views
6,523
Views on SlideShare
3,077
Embed Views
3,446

Actions

Likes
2
Downloads
6
Comments
0

6 Embeds 3,446

http://fivestar.hatenablog.com 3390
http://webcache.googleusercontent.com 49
http://clipboard.com 3
http://paper.li 2
http://a0.twimg.com 1
http://cache.yahoofs.jp 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Twigエクステンションの作り方 Twigエクステンションの作り方 Presentation Transcript

    • Twig2011.12.04 Symfony #5 @fivestr
    • ABOUT ME @fivestr PHP
    • TwigTwig TIPS
    • Twig
    • Twig{{ foo }} => <?php echo $foo ?>{% if %}...{% endif %}
    • Twig{{ foo(arg) }} :{{ arg|foo }} :{% if arg is foo %} :{% foo %}{% endfoo %} :
    • TwigTwig_Extension
    • DemoExtensionsrc/Acme/DemoBundle/Twig/Extension/DemoExtension.phpcode
    • class DemoExtension extends Twig_Extension{ public function getFunctions() { return array( code => new Twig_Function_Method( $this, getCode, array(is_safe => array(html)) ), ); }}
    • getFunctions() getFunctions() Twig
    • Twig_Function_Method( $this, ‘getCode’, $options)public function getCode($template) {}{{ code(template) }} $this->getCode($template)
    • getFilters() / getTests()Twig_Filter_Method / Twig_Filter_Test
    • DI twig.extension