<?php

/**
 * Class TemplateParser
 * Contains a variable array, it expands the array so therefore its contents become local variables in their own right, then includes a template page and renders.
 */
class TemplateParser
{
   /**
    * @var
    */
   private $varArray;
   private $template;

   public function __construct($array, $template)
   {
      $this->varArray = $array;
      $this->template = $template;
   }

   /**
    * Renders the page
    */
   public function render()
   {
      extract($this->varArray);
      require_once($this->template);
   }
}
