title: How to properly use if not statement with twig
body: <p>I have been trying to figure out how to use the <code>if not</code> clause with Twig template engine.</p>
  
  <p>According to the <a href="http://twig.sensiolabs.org/doc/tags/if.html" rel="noreferrer">documents</a>:</p>
  
  <blockquote>
    <p>You can also use <em>not</em> to check for values that evaluate to <em>false</em>:</p>
  </blockquote>
  
  <p>So I'm trying to use it like this:</p>
  
  <pre><code>{% if not signed_in %}
   You are not signed in.
  {% endif %}
  </code></pre>
  
  <p>And <code>signed_in</code> comes from a middleware. Looking like this:</p>
  
  <pre><code>    if (!$this-&gt;container-&gt;auth-&gt;check()) {
          /* Render a Sign-up */
          return $this-&gt;container-&gt;view-&gt;render($response, 'subscriber/index.twig', ['signed_in' =&gt; false]);
      }
  </code></pre>
  
  <p>So if I <code>{{ dump(signed_in) }}</code> when I'm not signed in it returns <code>false</code>. But when I'm signed in, <code>singed_in</code> returns <code>null</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/z0WF3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/z0WF3.png" alt="Not signed in left. Signed in on right"></a></p>
  
  <p>The current solution I'm going with is <code>{% if signed_in is defined %}</code>, but that is actually not what I'm looking for, or is it?</p>