質問するログイン新規登録

回答編集履歴

1

ミスがあったため修正。

2017/01/10 17:18

投稿

kei344
kei344

スコア69625

answer CHANGED
@@ -1,1 +1,21 @@
1
- `==` を `===` にしてみては?
1
+ `==` を `===` にしてみては?
2
+
3
+ ---
4
+
5
+ **追記:**
6
+
7
+ 失礼しました、` is same as() ` を使うようです。
8
+
9
+ 【php - How to check for null in Twig? - Stack Overflow】
10
+ [http://stackoverflow.com/questions/3264889/how-to-check-for-null-in-twig](http://stackoverflow.com/questions/3264889/how-to-check-for-null-in-twig)
11
+
12
+ 【same as - Documentation - Twig - The flexible, fast, and secure PHP template engine】
13
+ [http://twig.sensiolabs.org/doc/2.x/tests/sameas.html](http://twig.sensiolabs.org/doc/2.x/tests/sameas.html)
14
+ > same as checks if a variable is the same as another variable. This is the equivalent to === in PHP:
15
+ > ```PHP
16
+ > {% if foo.attribute is same as(false) %}
17
+ > the foo attribute really is the 'false' PHP value
18
+ > {% endif %}
19
+ > ```
20
+
21
+