title: How to define a variable in Cakephp
body: <p>I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this </p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;hidden('status_type', array('value'=&gt;$view)); ?&gt;
  </code></pre>
  
  <p>Here is how im defining my variable in the controller</p>
  
  <pre><code>class ItQueriesController extends AppController {
  
  var $view = 'Open';
  
  public function index() {
  $this-&gt;ItQuery-&gt;recursive = 0;
  $this-&gt;set('view', $this-&gt;view);
  
  }
  
  //Other Code
  
  }
  </code></pre>
  
  <p>and here is where im trying to pass the variable as a hidden field</p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;create('ItQuery'); ?&gt;
  &lt;?php echo __('Add It Query'); ?&gt;&lt;/legend&gt;
  &lt;?php
  echo $this-&gt;Form-&gt;input('status_type', array('type' =&gt; 'hidden', 'value'=&gt;$view));
  ?&gt;
  &lt;?php echo $this-&gt;Form-&gt;end(__('Submit')); ?&gt;
  </code></pre>
  
  <p>Can some please show me how to fix this</p>