Textpattern PHP Cross Reference Content Management Systems

Summary: /textpattern/vendors/Netcarver/Textile/Tag.php - 121 lines - 3565 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.

bc. use Netcarver\Textile\Tag;
$img = new Tag('img');
echo (string) $img->class('big blue')->src('images/elephant.jpg');

__construct($name, array $attributes = null, $selfclosing = true)  line: 79
Constructor.

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

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

return: string A HTML element

title

Body