Пример #1
0
 function render_content($content, $layout = 'layouts/default.twig', $meta = '')
 {
     if (isset($_GET['disable_cache'])) {
         $_SESSION['disable_cache'] = true;
     }
     $this->pre_content = $content;
     $this->meta = $meta;
     $this->run_theme_script();
     $this->page->logged_in = $this->logged_in;
     $layout = $this->load_layout($layout, $this->theme);
     $content = $this->twig->render($layout->file, array_merge(self::$params, ['this' => &$this, 'layout_id' => $layout->getID()]));
     //Rather attach scripts and css here then in the template
     $c = Wa72\HtmlPageDom\HtmlPageCrawler::create($content);
     if (G()->logged_in()) {
         $this->attach_admin($c);
     }
     //		$this->replace_cdn_script_tags($c);
     $content = $c->saveHTML();
     if (!G()->logged_in() && empty($_POST)) {
         $this->cache_data($slug, $content);
     } else {
         $this->remove_cache($slug);
     }
     echo $content;
 }
Пример #2
0
 /**
  * 
  * @return Wa72\HtmlPageDom\HtmlPageCrawler
  */
 function &c()
 {
     if ($this->c) {
         return $this->c;
     } else {
         return $this->c = Wa72\HtmlPageDom\HtmlPageCrawler::create($this->area->html);
     }
 }