public function setDirectory($directory)
    {
        if (class_exists('\Latte\Engine', true))
        {
            // If possible, load Latte\Engine
            $this->latte = new Latte;
            $this->latte->setTempDirectory(realpath(Core::$tempDir . DS . 'Latte'));
        }
        else
        {
            throw new LayoutException("Could not load LatteEngine. Is it installed or Composer not loaded?", 1);
        }
    }