public function compile() { if ($this->resource === null) { throw new TemplateException('Template has no resource to load. Oops.'); } if ($this->compiled === null) { $this->compiled = $this->compiler->run($this->resource, $this->resourceList); } return $this->compiled; }