title: How to know if a variable is set in the view
body: <p>I'd like to know if there's a way to know if a variable exists in a view.</p>
  
  <p>I'm creating a custom form's builder for my app theme and I'd like to include the <code>$errors</code> variable in a HTML tag. Any way to know if it's previously set in the view?</p>
  
  <p><strong>Update</strong>
  I meant how to access a view var outside the view. How to access the $errors var from somewhere else, a package for instance.</p>
  
  <p>I'm currently creating a custom form builder:</p>
  
  <pre><code>{{ MyFormBuilder::text('name', 'value', array()) }}
  </code></pre>
  
  <p>It should print</p>
  
  <pre><code>&lt;input name="name" value="value" ... /&gt;
  &lt;p&gt;ERRORS NAME REQUIRED&lt;/p&gt;
  </code></pre>
  
  <p>The errors <code>&lt;p&gt;</code> tag only if an error found validating this field. I want to check from my <code>text()</code> function if there's an error in <code>$errors</code>.</p>
  
  <p>I've tried using <code>global $errors</code> in my function, but it does not work...</p>
  
  <p>I hope it's a bit more clear ;)</p>
  
  <p><strong>Solved</strong>
  Using <code>Session::get('errors');</code> ;D
  Thanks to @machuga.</p>