title: Cakephp forms - Is there a way to make a field read only (in the view)
body: <p>I have a Cakephp 1.3 form that allows users to edit the profile data. But some of the information in the forms needs to be read only (sometimes). </p>
  
  <p>Is my only option to echo and format the field contents in the read only case or is there a flag in the Cake form that allows for read only fields. Ideally the read only fields would be greyed out similar to other interfaces.</p>
  
  <pre><code>    echo $this-&gt;Form-&gt;create('User', array('url' =&gt; array('controller' =&gt; 'User', 'action'=&gt;'editUser')));
  
      echo $this-&gt;Form-&gt;input('id', array('type'=&gt;'hidden'));
  
  If (!isset($IsAdmin)) {
      // Only display username - read only! Add code here
      echo $this-&gt;Form-&gt;input('username', array('label' =&gt; __d('users', 'User',true)));
  } else {
      // Admins can edit user names
      echo $this-&gt;Form-&gt;input('username', array('label' =&gt; __d('users', 'User',true)));
  }           
  
   ... more fields here
  
      echo $this-&gt;Form-&gt;end(__d('users', 'Submit',true));
  </code></pre>