title: CakePHP more efficient way of setting empty variables from model into view
body: <p>Consider such code in CakePHP:</p>
  
  <pre><code>$query =  $this-&gt;find('first'...);
  </code></pre>
  
  <p>That produces this array:</p>
  
  <pre><code>[UserAddress] =&gt; Array
      (
          [address_name] =&gt; Abc 55 Avenue
          [address_id] =&gt; 6
          [country_id] =&gt; 9
          [city_id] =&gt; 35
          [Country] =&gt; Array
              (
                  [country_name] =&gt; 'China'
              )
      [City] =&gt; Array
          (
              [city_name] =&gt; Null
          )
  )
  
  $this-&gt;set('data', $query);
  </code></pre>
  
  <p>Now if I use city name in the view like: </p>
  
  <pre><code>echo $this-&gt;data['UserAddress']['City']['city_name']; 
  </code></pre>
  
  <p>I'll get a 'notice' because city_name isn't set. Can anyone suggest more efficient ways to set 'unset' variables to '' (empty string) than writing everywhere </p>
  
  <pre><code>echo isset($this-&gt;data['UserAddress']['address_name']) ? $this-&gt;data['UserAddress']['address_name'] : '';
  </code></pre>
  
  <p>for null values in arrays got from model queries?<br>
  Thanks.</p>