public function finish() { header('Content-Type: application/json'); $this->data = json_encode($this->data); $this->data = preg_replace_callback('/\\{ICON:([\\w-]+)\\}/s', function ($icon) { return addslashes(Iconset::instance()->{$icon[1]}); }, $this->data); return $this->data; }
public function finish() { /** @var \Base $f3 */ $f3 = \Base::instance(); include 'app/loader.php'; if ($this->data) { $f3->mset($this->data); } /* 3-step processing of the inner page content: - render page - process tags - prepare data for outer page rendering */ $body = $this->post_render($this->tagWork(\Template::instance()->render('body.html'))); $body = preg_replace_callback('/\\{ICON:([\\w-]+)\\}/s', function ($icon) { return Iconset::instance()->{$icon[1]}; }, $body); $f3->set('BODY', $body); return \Template::instance()->render('layout.html'); }
public function finish() { /** @var \Base $f3 */ $f3 = \Base::instance(); $cfg = $f3->get('CONFIG'); if ($this->data) { $f3->mset($this->data); } if (isset($this->JS['head'])) { $f3->set('JS_HEAD', implode("\n", $this->JS['head'])); } if (isset($this->JS['body'])) { $f3->set('JS_BODY', implode("\n", $this->JS['body'])); } $f3->set('TITLE', implode($cfg['page_title_separator'], array_merge([$cfg['page_title']], $this->title))); $f3->set('DEBUGLOG', $f3->get('DB')->log()); return preg_replace_callback('/\\{ICON:([\\w-]+)\\}/s', function ($icon) { return Iconset::instance()->{$icon[1]}; //return "#"; }, \Template::instance()->render('layout.html')); return $body; }