title: What are the advantages of having a View per Controller
body: <p>I am unsure as to what the advantages of having a <code>View</code> per <code>Controller</code> are? Anything I have read about <code>Views</code> has not clearly shown or demonstrated why you should have a <code>View</code> per <code>Controller</code>.</p>
  
  <p>At the moment I have something like this (Shortened down to just the main methods):</p>
  
  <pre><code>interface ViewInterface {
      public function render();
  }
  
  class View implements ViewInterface {
  
      private $template;
  
      public function __construct($template = NULL) {
  
          if($template !== NULL) {
              $this-&gt;setTemplate($template);
          }
      }
  
      public function render() { 
          ob_start();
          require(PATH_TEMPLATES . $this-&gt;template . '.php');
          return ob_get_clean();
      }
  
  }
  
  class CompositeView implements ViewInterface {
  
      private $views;
  
      public function attachView(ViewInterface $view) {
          $this-&gt;views[] = $view;
          return $this;
      }
  
      public function render() {
  
          $output = '';
          foreach($this-&gt;views as $view) {
              $output .= $view-&gt;render();
          }
  
          return $output;
      }
  
  }
  </code></pre>
  
  <p>Let's say I want to render the privacy policy page, I can do it like this</p>
  
  <pre><code>$header = new View('common/header');
  $body = new View('privacy-policy');
  $footer = new View('common/footer');
  
  $compositeView = new CompositeView();
  $compositeView-&gt;attachView($header)
                -&gt;attachView($body)
                -&gt;attachView($footer);
  
  $compositeView-&gt;render();
  </code></pre>
  
  <p>What is wrong with this? What advantages do you gain from having a separate <code>View</code> for each <code>Controller</code>? </p>
  
  <p>Any advice would be great thanks.</p>