title: Basic MVC (PHP) Structure
body: <p>I have the following data flow for a simple login form.</p>
  
  <p>User access controller PHP file. Controller includes model.php and view.php</p>
  
  <p>User submits form, controller sends POST data to model methods, and gets a result back. </p>
  
  <p>User is logged in, and forwarded to a different view (login success message) by the controller.</p>
  
  <p>Currently my views are static HTML (no PHP), so here is my question. What is the correct way to then pass the user a welcome message, e.g "Hello, Craig!"?</p>
  
  <p>Is the view allowed PHP snippets, e.g </p>
  
  <pre><code>&lt;?php echo $username; ?&gt; 
  </code></pre>
  
  <p>since the model is loaded before it in the controller file?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit:</strong> Is it better practice then to allow the view to access specific class methods e.g </p>
  
  <pre><code>&lt;?php $user-&gt;getUsername(); ?&gt;
  </code></pre>
  
  <p>as opposed to just variables? </p>
  
  <hr>
  
  <p>Based on other answers, I have found a very useful article, which you may also be interested in.</p>
  
  <p><a href="http://www.nathandavison.com/posts/view/7/custom-php-mvc-tutorial-part-5-views" rel="noreferrer">http://www.nathandavison.com/posts/view/7/custom-php-mvc-tutorial-part-5-views</a></p>