method html documentation in bbn\Html\Element

Returns the corresponding HTML string

function($with_js = 1) { $html = ''; if ( $this->tag ){ $this->update(); // TAG $html .= '<'.$this->tag; foreach ( $this->attr as $key => $val ){ if ( \is_string($key) ){ $html .= ' '.htmlspecialchars($key).'="'; if ( is_numeric($val) ){ $html .= $val; } else if (\is_string($val) ){ $html .= htmlspecialchars($val); } $html .= '"'; } } if ( \count($this->css) > 0 ){ $html .= self::cssToString($this->css); } if ( $this->xhtml ){ $html .= ' /'; } $html .= '>'; if ( !\in_array($this->tag, self::$self_closing_tags) ){ if ( isset($this->text) ){ $html .= $this->text; } if ( isset($this->content) ){ // @todo: Add the ability to imbricate elements if ( \is_string($this->content) ){ $html .= $this->content; } else if ( \is_array($this->content) ){ foreach ( $this->content as $c ){ if ( \is_array($c) ){ $c = new bbn\Html\Element($c); } $html .= $c->html($with_js); } } } $html .= 'tag.'>'; } if ( isset($this->placeholder) && strpos($this->placeholder,'%s') !== false ){ $html = sprintf($this->placeholder, $html); } } return $html; }

Returns the corresponding HTML string BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.