title: controller/model code appearing at top of page in cakePHP
body: <p>I'm following the cakePHP "getting started" here:</p>
  
  <p><a href="http://book.cakephp.org/2.0/en/getting-started.html" rel="nofollow">http://book.cakephp.org/2.0/en/getting-started.html</a></p>
  
  <p>One thing I got stuck on is that I created the model, controller, and view for Posts eg:</p>
  
  <pre><code>&lt;docroot&gt;/app/Controller/PostsController.php
  &lt;docroot&gt;/app/Model/Post.php
  &lt;docroot&gt;/app/View/Posts/index.ctp
  </code></pre>
  
  <p><em>exactly</em> as outlined in the link above. The problem is that I was getting the error:</p>
  
  <p>Error: PostsController could not be found.</p>
  
  <p>And the Controller code was being printed at the top of the page.</p>
  
  <p>I finally figured out that I had to add</p>
  
  <pre><code>&lt;?php [code] ?&gt;
  </code></pre>
  
  <p>around the code that the tutorial specified for the controller file. ie intstead of:</p>
  
  <pre><code>class PostsController extends AppController {
      public $helpers = array('Html', 'Form');
  
      public function index() {
          $this-&gt;set('posts', $this-&gt;Post-&gt;find('all'));
      }
  }
  </code></pre>
  
  <p>I had:</p>
  
  <pre><code>&lt;?php
  class PostsController extends AppController {
      public $helpers = array('Html', 'Form');
  
      public function index() {
          $this-&gt;set('posts', $this-&gt;Post-&gt;find('all'));
      }
  }
  ?&gt;
  </code></pre>
  
  <p>Once I did that, it worked, kinda. Except then I was getting the model "code" printed at the top of the page. Surrounding <em>that</em> with the php escape (as in the controller above) resolved that issue, but I'm concerned that this is hinting that I've misconfigured something while setting up cake.</p>
  
  <p>My question: is the tutorial wrong? Why would it not specify the use of the php escapes (or whatever you call those things) if they are needed to get this stuff working? Or, if they should not be needed, can anyone suggest a reason that in my case they are needed? Maybe I've mis-configured something before this step...</p>
  
  <p>Thanks, I looked for a similar question on SO but was unable to locate one, but please feel free to direct me if this is a duplicate...</p>