2018-02-01から1日間の記事一覧

【Twig】対象の文字列が特定の文字列を含んでいるかどうかを判定する

in 演算子を使う。 Twig for Template Designers - Documentation - Twig - The flexible, fast, and secure PHP template engine {# returns true #} {{ 1 in [1, 2, 3] }} {{ 'cd' in 'abcde' }} 見ての通り in 演算子は配列でも文字列でも使うことができ…