Textpattern PHP Cross Reference Content Management Systems

Summary: /textpattern/vendors/Netcarver/Textile/Tag.php - 118 lines - 3357 bytes - Source - Print

Description: Textile - A Humane Web Text Generator.

Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Tag:: (2 methods):
__construct()
__toString()

Class: Tag

Renders HTML elements.

This class can be used to HTML elements. It
does not sanitise attribute values, but can be
used to construct tags with nice object oriented
syntax.

<code>
use Netcarver\Textile\Tag;
$img = new Tag('img');
echo (string) $img->class('big blue')->src('images/elephant.jpg');
</code>
__construct($name, array $attributes = null, $selfclosing = true)  line: 74
Constructor.

param: string $name        The tag name
param: array  $attributes  An array of attributes
param: bool   $selfclosing Whether the tag is self-closing
__toString()  line: 89
Returns the tag as HTML.

<code>
$img = new Tag('img');
$img->src('images/example.jpg')->alt('Example image');
echo (string) $img;
</code>

return: string A HTML element

title

Body