Example #1
1
 /**
  * Renders the content to be inserted at the end of the body section.
  * The content is rendered using the registered JS code blocks and files.
  *
  * @return string the rendered content
  */
 protected function renderBodyEndHtml()
 {
     $lines = [];
     if (!empty($this->cssFiles[self::POS_END])) {
         $lines[] = implode("\n", $this->cssFiles[self::POS_END]);
     }
     if (!empty($this->jsFiles[self::POS_END])) {
         $lines[] = implode("\n", $this->jsFiles[self::POS_END]);
     }
     $scripts = [];
     if (!empty($this->js[self::POS_END])) {
         $scripts[] = implode("\n", $this->js[self::POS_END]);
     }
     if (!empty($scripts)) {
         $lines[] = Html::script(implode("\n", $scripts), ['type' => 'text/javascript']);
     }
     $lines[] = '</body>';
     return empty($lines) ? '' : implode("\n", $lines);
 }