Php blt-vol2

  • View
    2.730

  • Download
    0

Embed Size (px)

Text of Php blt-vol2

PowerPoint

Enjoy, TwigPHP BLT #22016.01.13 @m_norii

About me (HAYASHI Masanori)19740912 (41)EMTG

@m_noriihttp://norii.hatenablog.com/https://www.facebook.com/m.norii

2

http://emtg.co.jp/archives/2975

http://emtg.co.jp/archives/2975!!http://emtg.co.jp/recruit

Enjoy, TwigIncludeignore missingForsliceVerbatimtemplate_from_string

Includeignore missing()//foo.html.twig {% include 'foo.html.twig' %}

//foo.html.twig {% include 'foo.html.twig' ignore missing %}

////foo.html.twig bar.html.twig{% include ['foo.html.twig', 'bar.html.twig'] %}

//foo.html.twig bar.html.twig//{% include ['foo.html.twig', 'bar.html.twig'] ignore missing %}

ForFor if

  • {% for user in users if user.active %}
  • {{user.username}} {% endfor %}

Slicearray_slice() mb_substr()/substr() {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %} i = 23{% endfor %}

{{ 'Hello'|slice(1, 2) }}{# el #}

VerbatimTwig {{ }}{% %}Twig

{% verbatim %} {% if date() >= date('2016-01-08 00:00:00') %} {% endif %} {% endverbatim %}

template_from_stringTwigeval

CMSTwigWordpress

template_from_string

template_from_string()DBTwigTemplate_from_string() template_from_string()

Enjoy, Twig!!