Exemplo n.º 1
0
 /**
  * Использовать во View для вставки вызова всех скриптов
  * @return string
  */
 function __toString()
 {
     try {
         Manager::init();
         return trim($this->getExternal() . PHP_EOL . $this->getInline() . PHP_EOL . $this->getOnload() . $this->getNoscript());
     } catch (\Exception $e) {
         dd($e);
     }
 }
Exemplo n.º 2
0
 /**
  * Формирование обоих списков (внешние и инлайн стили)
  * @return string
  */
 function __toString()
 {
     try {
         Manager::init();
         $_css = [];
         $css = $this->getExternal();
         if ($css) {
             $_css[] = str_replace(PHP_EOL, "        " . PHP_EOL, $css);
         }
         $css_inline = $this->getInline(true);
         if ($css_inline) {
             $css_inline = str_replace(PHP_EOL, PHP_EOL . "    ", $css_inline);
             $_css[] = "        " . str_replace(PHP_EOL, PHP_EOL . "    ", $css_inline);
         }
         return implode("", $_css);
     } catch (\Exception $e) {
         return $e->getMessage();
     }
 }