/** * Build the template file indicated by key into string. Use data in * the dictionary as scope * * @param string $key template file identifier * @param array $data used for private scope * @return string */ public function build() { $data = $this->getAll(); if ($this->isViewPackage()) { $name = $this->getViewPkgName(); $result = ViewCompositor::composePackage($name, $data); } else { $file = $this->getFile(); $result = ViewCompositor::composeFile($file, $data); } return $result; }
/** * Build the template file indicated by key into string. Use data in * the dictionary as scope * * @param string $key template file identifier * @param array $data used for private scope * @return string */ public function build() { if ($this->templateCount() > 0) { $this->buildTemplates(); } return ViewCompositor::composeList($this->getAll()); }
/** * Clientside processing expects this datastructure back. To make assigns * consistent I elected to defer generating the correct message format * until all the data has been assigned. All the original assignments are * held now in data instead of being the root array. * * @return string */ public function build() { return ViewCompositor::composeJson(array('code' => $this->getStatusCode(), 'message' => $this->getStatusText(), 'data' => $this->getAll())); }