/** * Returns the HTML code for inclusion. * * @return string */ public function render() { $return = array(); // Render meta keywords tag if ($this->keywords) { $return[] = Ku_HTML::meta(implode(', ', $this->keywords), array('name' => 'keywords')); } // Render meta description tag if ($this->description) { $return[] = Ku_HTML::meta(implode(', ', $this->description), array('name' => 'description')); } // Render other meta tags foreach ($this->meta as $item) { $return[] = (string) $item; } // Render base tag if ($this->base) { $return[] = is_string($this->base) ? Ku_HTML::base($this->base) : (string) $this->base; } // Render title tag $title = is_array($this->title) ? implode($this->title_separator, $this->title) : $this->title; $return[] = is_string($title) ? '<title>' . HTML::chars($title, FALSE) . '</title>' : (string) $title; // Render styles foreach ($this->styles as $item) { $return[] = (string) $item; } // Render scripts foreach ($this->scripts as $item) { $return[] = (string) $item; } // Render links foreach ($this->links as $item) { $return[] = (string) $item; } // Remove empty lines $return = array_filter($return, 'strlen'); return implode("\n", $return); }