回答編集履歴

1

ミスがあったため修正。

2017/01/10 17:18

投稿

kei344
kei344

スコア69583

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