Beispiel #1
0
 /**
  * Renders the group
  *
  * @param  boolean $showChrome Whether or not the item should render descriptive chrome
  * @return String              HTML text
  */
 public function render($showChrome = true)
 {
     if ($showChrome) {
         return View::render('group', array('title' => $this->title, 'id' => $this->id, 'copy' => $this->copy, 'patterns' => $this->patterns->render()));
     } else {
         return $this->patterns->render($showChrome);
     }
 }
Beispiel #2
0
 /**
  * Renders the pattern
  *
  * @param  boolean $showChrome Whether or not the item should render descriptive chrome
  * @return String              HTML text
  */
 public function render($showChrome = true)
 {
     $html = $this->template->render($this->data);
     // Tidy the HTML
     $parser = new Parser();
     $html = $parser->indent($html);
     if ($showChrome) {
         return View::render('pattern', ['title' => $this->title, 'id' => $this->id, 'html' => $html, 'template' => $this->templateRaw, 'copy' => $this->copy, 'data' => json_encode($this->data, JSON_PRETTY_PRINT)]);
     } else {
         return $html;
     }
 }
Beispiel #3
0
 /**
  * Get the menu listing all the page templates in the site
  *
  * @return String
  */
 public function getMenu()
 {
     $viewData = new ViewData(array('templates' => $this->getTemplates()));
     return View::render('menu', $viewData);
 }