Ejemplo n.º 1
0
 /**
  * Render markdown input
  *
  * @param  string $markDownSyntax Markdown syntax to put inside textarea
  * @param  string $template       Template name
  * @return string HTML string
  */
 public function renderInput($markdownSyntax = '', $template = '_markdown/form')
 {
     $this->view->set('app', $this->app);
     $this->view->set('id', $this->random());
     $this->view->set('markdown', $markdownSyntax);
     $counter = count(explode('.php', $template));
     $bladeCounter = count(explode('.blade.php', $template));
     if ($counter == 1 and $bladeCounter == 1) {
         $template .= '.php';
     }
     return $this->view->fetch($template);
 }
Ejemplo n.º 2
0
 public function fetch($template, $data = null)
 {
     $data = is_array($data) ? $data : [];
     $data['css_files'] = $this->cssFiles;
     $data['js_files'] = $this->jsFiles;
     return parent::fetch($template, $data);
 }
Ejemplo n.º 3
0
 /**
  * [fetch description]
  *
  * @param [type] $template [description]
  *
  * @return [type] [description]
  */
 public function fetch($template)
 {
     $app = App::getInstance();
     if (empty($template)) {
         return $this->data['body'];
     } else {
         if ($app->theme) {
             $template = $app->theme->resolve($template, $this) ?: $template;
         }
         $html = parent::fetch($template);
         $layoutTemplate = null;
         if ($this->layout) {
             if ($app->theme) {
                 $layoutTemplate = $app->theme->resolve($this->layout, $this->layoutView);
             } else {
                 $layoutTemplate = $this->layout;
             }
         }
         if ($layoutTemplate) {
             $this->layoutView->replace($this->all());
             $this->layoutView->set('body', $html);
             return $this->layoutView->render($layoutTemplate);
         } else {
             return $html;
         }
     }
 }