original_string: protected function renderOutput($templates)
      {
          $html = '';
  
          if (!$this->isInternalRoute()) {
  
              if (!is_array($templates)) {
                  $templates = array('region_content' => (string) $templates);
              }
  
              $templates = array_merge($this->templates, $templates);
  
              $layout = $templates['layout'];
              unset($templates['layout']);
  
              $body = $data = $this->data;
  
              foreach ($templates as $id => $template) {
                  if (strpos($id, 'region_') === 0) {
                      $body[$id] = $this->renderRegion($id, $template);
                  }
              }
  
              $data['_head'] = $data['_body'] = '';
  
              if (!empty($templates['head'])) {
                  $data['_head'] = $this->render($templates['head'], $this->data);
              }
  
              if (!empty($templates['body'])) {
                  $data['_body'] = $this->render($templates['body'], $body);
              }
  
              $html = $this->render($layout, $data, false);
          }
  
          $this->hook->attach('template.output', $html, $this);
          return $html;
      }
code: protected function renderOutput($templates)
      {
          $html = '';
  
          if (!$this->isInternalRoute()) {
  
              if (!is_array($templates)) {
                  $templates = array('region_content' => (string) $templates);
              }
  
              $templates = array_merge($this->templates, $templates);
  
              $layout = $templates['layout'];
              unset($templates['layout']);
  
              $body = $data = $this->data;
  
              foreach ($templates as $id => $template) {
                  if (strpos($id, 'region_') === 0) {
                      $body[$id] = $this->renderRegion($id, $template);
                  }
              }
  
              $data['_head'] = $data['_body'] = '';
  
              if (!empty($templates['head'])) {
                  $data['_head'] = $this->render($templates['head'], $this->data);
              }
  
              if (!empty($templates['body'])) {
                  $data['_body'] = $this->render($templates['body'], $body);
              }
  
              $html = $this->render($layout, $data, false);
          }
  
          $this->hook->attach('template.output', $html, $this);
          return $html;
      }
code_tokens: protected function renderOutput ( $ templates ) { $ html = '' ; if ( ! $ this -> isInternalRoute ( ) ) { if ( ! is_array ( $ templates ) ) { $ templates = array ( 'region_content' => ( string ) $ templates ) ; } $ templates = array_merge ( $ this -> templates , $ templates ) ; $ layout = $ templates [ 'layout' ] ; unset ( $ templates [ 'layout' ] ) ; $ body = $ data = $ this -> data ; foreach ( $ templates as $ id => $ template ) { if ( strpos ( $ id , 'region_' ) === 0 ) { $ body [ $ id ] = $ this -> renderRegion ( $ id , $ template ) ; } } $ data [ '_head' ] = $ data [ '_body' ] = '' ; if ( ! empty ( $ templates [ 'head' ] ) ) { $ data [ '_head' ] = $ this -> render ( $ templates [ 'head' ] , $ this -> data ) ; } if ( ! empty ( $ templates [ 'body' ] ) ) { $ data [ '_body' ] = $ this -> render ( $ templates [ 'body' ] , $ body ) ; } $ html = $ this -> render ( $ layout , $ data , false ) ; } $ this -> hook -> attach ( 'template.output' , $ html , $ this ) ; return $ html ; }
docstring: Renders all templates before sending them to a browser
  @param array|string $templates
  @return string
docstring_tokens: Renders all templates before sending them to a browser