public function flush($echo = true) { $this->output = []; foreach ($this->queue as $name => $item) { if ($item['type'] == self::TYPE_CALLABLE_OBJECT) { $this->output[] = $item['content']->execute(); } else { $this->output[] = $item['content']; } } return parent::flush($echo); }
public function flush($echo = true) { $this->output = []; foreach ($this->queue as $name => $item) { switch ($item['type']) { case self::TYPE_RAW: $this->output[] = Html5::jsInline($item['content']); break; case self::TYPE_VAR: $content = []; foreach ($item['content'] as $varName => $varValue) { $content[] = 'var ' . $varName . ' = ' . $this->getVarValue($varValue) . ';'; } $this->output[] = Html5::jsInline(implode(PHP_EOL, $content)); break; default: $this->output[] = Html5::js($item['content']); break; } } return parent::flush($echo); }
public function flush($echo = true) { $this->output = []; $this->output = []; foreach ($this->queue as $name => $item) { switch ($item['type']) { case self::TYPE_RAW: $this->output[] = Html5::cssInline($item['content']); break; case self::TYPE_VAR: $content = []; foreach ($item['content'] as $css) { $content[] = $this->getNames($css['names']) . '{' . $this->getProperties($css['properties']) . '}'; } $this->output[] = Html5::cssInline(implode(PHP_EOL, $content)); break; default: $this->output[] = Html5::css($item['content']); break; } } return parent::flush($echo); }