Sections

Class Phalcon\Html\Attributes

Исходный код на GitHub

Namespace Phalcon\Html   Uses Phalcon\Collection, Phalcon\Html\Attributes\RenderInterface, Phalcon\Tag   Extends Collection   Implements RenderInterface

This class helps to work with HTML Attributes

Методы

public function __toString(): string;

Alias of the render method

public function render(): string;

Render attributes as HTML attributes

Interface Phalcon\Html\Attributes\AttributesInterface

Исходный код на GitHub

Namespace Phalcon\Html\Attributes   Uses Phalcon\Html\Attributes
  • Phalcon\Html\Attributes\AttributesInterface
  • Interface Phalcon\Html\Attributes\AttributesInterface */

Методы

public function getAttributes(): Attributes;

Get Attributes

public function setAttributes( Attributes $attributes ): AttributesInterface;

Set Attributes

Interface Phalcon\Html\Attributes\RenderInterface

Исходный код на GitHub

Namespace Phalcon\Html\Attributes
  • Phalcon\Html\Attributes\RenderInterface
  • Interface Phalcon\Html\Attributes\RenderInterface */

Методы

public function render(): string;

Generate a string represetation

Class Phalcon\Html\Breadcrumbs

Исходный код на GitHub

Namespace Phalcon\Html   Uses Phalcon\Di\DiInterface

Phalcon\Html\Breadcrumbs

This component offers an easy way to create breadcrumbs for your application. The resulting HTML when calling render() will have each breadcrumb enclosed in <dt> tags, while the whole string is enclosed in <dl> tags.

Properties

/**
 * Keeps all the breadcrumbs
 *
 * @var array
 */
private elements;

/**
 * Crumb separator
 *
 * @var string
 */
private separator =  / ;

/**
 * The HTML template to use to render the breadcrumbs.
 *
 * @var string
 */
private template = <dt><a href=\"%link%\">%label%</a></dt>;

Методы

public function add( string $label, string $link = string ): Breadcrumbs;

Adds a new crumb.

// Adding a crumb with a link
$breadcrumbs->add("Home", "/");

// Adding a crumb without a link (normally the last one)
$breadcrumbs->add("Users");
public function clear(): void;

Clears the crumbs

$breadcrumbs->clear()
public function getSeparator(): string
public function remove( string $link ): void;

Removes crumb by url.

$breadcrumbs->remove("/admin/user/create");

// remove a crumb without an url (last link)
$breadcrumbs->remove();
public function render(): string;

Renders and outputs breadcrumbs based on previously set template.

echo $breadcrumbs->render();
public function setSeparator( string $separator )
public function toArray(): array;

Returns the internal breadcrumbs array

Class Phalcon\Html\Exception

Исходный код на GitHub

Namespace Phalcon\Html   Extends \Phalcon\Exception

Phalcon\Html\Tag\Exception

Exceptions thrown in Phalcon\Html\Tag will use this class

Abstract Class Phalcon\Html\Helper\AbstractHelper

Исходный код на GitHub

Namespace Phalcon\Html\Helper   Uses Phalcon\Escaper\EscaperInterface, Phalcon\Html\Exception

Class AbstractHelper

@property string $delimiter @property Escaper $escaper @property string $indent @property int $indentLevel

Properties

/**
 * @var string
 */
protected delimiter = ;

/**
 * @var EscaperInterface
 */
protected escaper;

/**
 * @var string
 */
protected indent =     ;

/**
 * @var int
 */
protected indentLevel = 1;

Методы

public function __construct( EscaperInterface $escaper );

AbstractHelper constructor.

protected function close( string $tag, bool $raw = bool ): string;

Produces a closing tag

protected function indent(): string;

Replicates the indent x times as per indentLevel

protected function orderAttributes( array $overrides, array $attributes ): array;

Keeps all the attributes sorted - same order all the tome

protected function renderArrayElements( array $elements, string $delimiter ): string;

Traverses an array and calls the method defined in the first element with attributes as the second, returning the resulting string

protected function renderAttributes( array $attributes ): string;

Renders all the attributes

protected function renderElement( string $tag, array $attributes = [] ): string;

Renders an element

protected function renderFullElement( string $tag, string $text, array $attributes = [], bool $raw = bool ): string;

Renders an element

protected function renderTag( string $tag, array $attributes = [], string $close = string ): string;

Renders a tag

protected function selfClose( string $tag, array $attributes = [] ): string;

Produces a self close tag i.e.

Abstract Class Phalcon\Html\Helper\AbstractList

Исходный код на GitHub

Namespace Phalcon\Html\Helper   Uses Phalcon\Html\Exception   Extends AbstractHelper

Class AbstractList

Properties

/**
 * @var array
 */
protected attributes;

/**
 * @var string
 */
protected elementTag = li;

/**
 * @var array
 */
protected store;

Методы

public function __invoke( string $indent = null, string $delimiter = null, array $attributes = [] ): AbstractList;
public function __toString();

Generates and returns the HTML for the list.

abstract protected function getTag(): string;

Returns the tag name.

Abstract Class Phalcon\Html\Helper\AbstractSeries

Исходный код на GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Class AbstractSeries

Properties

/**
 * @var array
 */
protected attributes;

/**
 * @var array
 */
protected store;

Методы

public function __invoke( string $indent = null, string $delimiter = null ): AbstractSeries;
public function __toString();

Generates and returns the HTML for the list.

abstract protected function getTag(): string;

Returns the tag name.

Class Phalcon\Html\Helper\Anchor

Исходный код на GitHub

Namespace Phalcon\Html\Helper   Uses Phalcon\Html\Exception   Extends AbstractHelper

Class Anchor

Методы

public function __invoke( string $href, string $text, array $attributes = [], bool $raw = bool ): string;

Produce a tag</p>

protected function processAttributes( string $href, array $attributes ): array;

Class Phalcon\Html\Helper\Base

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Base

Методы

public function __invoke( string $href = null, array $attributes = [] ): string;

Produce a <base/> tag.

Class Phalcon\Html\Helper\Body

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Body

Методы

public function __invoke( array $attributes = [] ): string;

Produce a <body> tag.

Class Phalcon\Html\Helper\Button

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Button

Методы

public function __invoke( string $text, array $attributes = [], bool $raw = bool ): string;

Produce a <button> tag.

Class Phalcon\Html\Helper\Close

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Extends | AbstractHelper |

Class Close

Методы

public function __invoke( string $tag, bool $raw = bool ): string;

Produce a </...> tag.

Class Phalcon\Html\Helper\Element

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Element

Методы

public function __invoke( string $tag, string $text, array $attributes = [], bool $raw = bool ): string;

Produce a tag.

Class Phalcon\Html\Helper\Form

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Form

Методы

public function __invoke( array $attributes = [] ): string;

Produce a <form> tag.

Class Phalcon\Html\Helper\Img

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Img

Методы

public function __invoke( string $src, array $attributes = [] ): string;

Produce a tag.

Abstract Class Phalcon\Html\Helper\Input\AbstractInput

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Html\Helper\AbstractHelper | | Extends | AbstractHelper |

Class AbstractInput

@property array $attributes @property string $type @property string $value

Properties

/**
 * @var string
 */
protected type = text;

/**
 * @var array
 */
protected attributes;

Методы

public function __invoke( string $name, string $value = null, array $attributes = [] ): AbstractInput;
public function __toString();

Returns the HTML for the input.

public function setValue( string $value = null ): AbstractInput;

Sets the value of the element

Class Phalcon\Html\Helper\Input\Checkbox

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Escaper\EscaperInterface, Phalcon\Helper\Arr | | Extends | AbstractInput |

Class Checkbox

@property array $label

Properties

/**
 * @var array
 */
protected label;

/**
 * @var string
 */
protected type = checkbox;

Методы

public function __construct( EscaperInterface $escaper );

AbstractHelper constructor.

public function __toString();

Returns the HTML for the input.

public function label( array $attributes = [] ): Checkbox;

Attaches a label to the element

Class Phalcon\Html\Helper\Input\Color

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Color

Properties

//
protected type = color;

Class Phalcon\Html\Helper\Input\Date

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Date

Properties

//
protected type = date;

Class Phalcon\Html\Helper\Input\DateTime

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class DateTime

Properties

//
protected type = datetime;

Class Phalcon\Html\Helper\Input\DateTimeLocal

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class DateTimeLocal

Properties

//
protected type = datetime-local;

Class Phalcon\Html\Helper\Input\Email

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Email

Properties

//
protected type = email;

Class Phalcon\Html\Helper\Input\File

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class File

Properties

//
protected type = file;

Class Phalcon\Html\Helper\Input\Hidden

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Hidden

Properties

//
protected type = hidden;

Class Phalcon\Html\Helper\Input\Image

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Image

Properties

//
protected type = image;

Class Phalcon\Html\Helper\Input\Input

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Input

Методы

public function setType( string $type ): AbstractInput;

Sets the type of the input

Class Phalcon\Html\Helper\Input\Month

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Month

Properties

//
protected type = month;

Class Phalcon\Html\Helper\Input\Numeric

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Numeric

Properties

//
protected type = numeric;

Class Phalcon\Html\Helper\Input\Password

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Password

Properties

//
protected type = password;

Class Phalcon\Html\Helper\Input\Radio

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | Checkbox |

Class Radio

Properties

/**
 * @var string
 */
protected type = radio;

Class Phalcon\Html\Helper\Input\Range

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Range

Properties

//
protected type = range;

Class Phalcon\Html\Helper\Input\Search

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Search

Properties

//
protected type = search;

Class Phalcon\Html\Helper\Input\Select

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Html\Helper\AbstractList | | Extends | AbstractList |

Class Select

@property string $elementTag @property bool $inOptGroup @property string $selected

Properties

/**
 * @var string
 */
protected elementTag = option;

/**
 * @var bool
 */
protected inOptGroup = false;

/**
 * @var string
 */
protected selected = ;

Методы

public function add( string $text, string $value = null, array $attributes = [], bool $raw = bool ): Select;

Add an element to the list

public function addPlaceholder( string $text, mixed $value = null, array $attributes = [], bool $raw = bool ): Select;

Add an element to the list

public function optGroup( string $label = null, array $attributes = [] ): Select;

Creates an option group

public function selected( string $selected ): Select;
protected function getTag(): string;
protected function optGroupEnd(): string;
protected function optGroupStart( string $label, array $attributes ): string;

Class Phalcon\Html\Helper\Input\Submit

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Submit

Properties

//
protected type = submit;

Class Phalcon\Html\Helper\Input\Tel

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Tel

Properties

//
protected type = tel;

Class Phalcon\Html\Helper\Input\Text

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Text

Class Phalcon\Html\Helper\Input\Textarea

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Helper\Arr, Phalcon\Html\Exception | | Extends | AbstractInput |

Class Textarea

Properties

/**
 * @var string
 */
protected type = textarea;

Методы

public function __toString();

Returns the HTML for the input.

Class Phalcon\Html\Helper\Input\Time

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Time

Properties

//
protected type = time;

Class Phalcon\Html\Helper\Input\Url

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Url

Properties

//
protected type = url;

Class Phalcon\Html\Helper\Input\Week

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |

Class Week

Properties

//
protected type = week;

Class Phalcon\Html\Helper\Label

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Label

Методы

public function __invoke( array $attributes = [] ): string;

Produce a <label> tag.

Class Phalcon\Html\Helper\Link

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Extends | AbstractSeries |

Class Link

Методы

public function add( string $rel, string $href ): Link;

Add an element to the list

protected function getTag(): string;

Class Phalcon\Html\Helper\Meta

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractSeries |

Class Meta

Методы

public function add( array $attributes = [] ): Meta;

Add an element to the list

public function addHttp( string $httpEquiv, string $content ): Meta;
public function addName( string $name, string $content ): Meta;
public function addProperty( string $name, string $content ): Meta;
protected function getTag(): string;

Class Phalcon\Html\Helper\Ol

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Extends | AbstractList |

Class Ol

Методы

public function add( string $text, array $attributes = [], bool $raw = bool ): AbstractList;

Add an element to the list

protected function getTag(): string;

Class Phalcon\Html\Helper\Script

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Extends | Style |

Class Script

Методы

protected function getAttributes( string $src, array $attributes ): array;

Returns the necessary attributes

protected function getTag(): string;

Class Phalcon\Html\Helper\Style

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractSeries |

Class Style

Методы

public function add( string $href, array $attributes = [] );

Add an element to the list

protected function getAttributes( string $href, array $attributes ): array;

Returns the necessary attributes

protected function getTag(): string;

Class Phalcon\Html\Helper\Title

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |

Class Title

@property array $append @property string $delimiter @property string $indent @property array $prepend @property string $title @property string $separator

Properties

/**
 * @var array
 */
protected append;

/**
 * @var array
 */
protected prepend;

/**
 * @var string
 */
protected title = ;

/**
 * @var string
 */
protected separator = ;

Методы

public function __invoke( string $separator = string, string $indent = null, string $delimiter = null ): Title;

Sets the separator and returns the object back

public function __toString();

Returns the title tags

public function append( string $text, bool $raw = bool ): Title;

Appends text to current document title

public function get(): string;

Returns the title

public function prepend( string $text, bool $raw = bool ): Title;

Prepends text to current document title

public function set( string $text, bool $raw = bool ): Title;

Sets the title

Class Phalcon\Html\Helper\Ul

Исходный код на GitHub

| Namespace | Phalcon\Html\Helper | | Extends | Ol |

Class Ul

Методы

protected function getTag(): string;

Class Phalcon\Html\Link\EvolvableLink

Исходный код на GitHub

| Namespace | Phalcon\Html\Link | | Uses | Psr\Link\EvolvableLinkInterface | | Extends | Link | | Implements | EvolvableLinkInterface |

Class Phalcon\Http\Link\EvolvableLink

@property array attributes @property string href @property array rels @property bool templated

Методы

public function withAttribute( mixed $attribute, mixed $value );

Returns an instance with the specified attribute added.

If the specified attribute is already present, it will be overwritten with the new value.

public function withHref( mixed $href );

Returns an instance with the specified href.

public function withRel( mixed $rel );

Returns an instance with the specified relationship included.

If the specified rel is already present, this method MUST return normally without errors, but without adding the rel a second time.

public function withoutAttribute( mixed $attribute );

Returns an instance with the specified attribute excluded.

If the specified attribute is not present, this method MUST return normally without errors.

public function withoutRel( mixed $rel );

Returns an instance with the specified relationship excluded.

If the specified rel is not present, this method MUST return normally without errors.

Class Phalcon\Html\Link\EvolvableLinkProvider

Исходный код на GitHub

| Namespace | Phalcon\Html\Link | | Uses | Psr\Link\EvolvableLinkProviderInterface, Psr\Link\LinkInterface | | Extends | LinkProvider | | Implements | EvolvableLinkProviderInterface |

Class Phalcon\Http\Link\LinkProvider

@property LinkInterface[] links

Методы

public function withLink( LinkInterface $link );

Returns an instance with the specified link included.

If the specified link is already present, this method MUST return normally without errors. The link is present if link is === identical to a link object already in the collection.

public function withoutLink( LinkInterface $link );

Returns an instance with the specified link removed.

If the specified link is not present, this method MUST return normally without errors. The link is present if link is === identical to a link object already in the collection.

Class Phalcon\Html\Link\Link

Исходный код на GitHub

| Namespace | Phalcon\Html\Link | | Uses | Phalcon\Collection, Phalcon\Collection\CollectionInterface, Psr\Link\LinkInterface | | Implements | LinkInterface |

Class Phalcon\Http\Link\Link

@property array attributes @property string href @property array rels @property bool templated

Properties

/**
 * @var Collection|CollectionInterface
 */
protected attributes;

/**
 * @var string
 */
protected href = ;

/**
 * @var Collection|CollectionInterface
 */
protected rels;

/**
 * @var bool
 */
protected templated = false;

Методы

public function __construct( string $rel = string, string $href = string, array $attributes = [] );

Link constructor.

public function getAttributes();

Returns a list of attributes that describe the target URI.

public function getHref();

Returns the target of the link.

The target link must be one of:

  • An absolute URI, as defined by RFC 5988.
  • A relative URI, as defined by RFC 5988. The base of the relative link is assumed to be known based on context by the client.
  • A URI template as defined by RFC 6570.

If a URI template is returned, isTemplated() MUST return True.

public function getRels();

Returns the relationship type(s) of the link.

This method returns 0 or more relationship types for a link, expressed as an array of strings.

public function isTemplated();

Returns whether or not this is a templated link.

protected function hrefIsTemplated( string $href ): bool;

Determines if a href is a templated link or not.

@see https://tools.ietf.org/html/rfc6570

Class Phalcon\Html\Link\LinkProvider

Исходный код на GitHub

| Namespace | Phalcon\Html\Link | | Uses | Psr\Link\LinkInterface, Psr\Link\LinkProviderInterface | | Implements | LinkProviderInterface |

Class Phalcon\Http\Link\LinkProvider

@property LinkInterface[] links

Properties

/**
 * @var LinkInterface[]
 */
protected links;

Методы

public function __construct( array $links = [] );

LinkProvider constructor.

public function getLinks();

Returns an iterable of LinkInterface objects.

The iterable may be an array or any PHP \Traversable object. If no links are available, an empty array or \Traversable MUST be returned.

public function getLinksByRel( mixed $rel );

Returns an iterable of LinkInterface objects that have a specific relationship.

The iterable may be an array or any PHP \Traversable object. If no links with that relationship are available, an empty array or \Traversable MUST be returned.

protected function getKey( LinkInterface $link ): string;

Returns the object hash key

Class Phalcon\Html\Link\Serializer\Header

Исходный код на GitHub

| Namespace | Phalcon\Html\Link\Serializer | | Uses | Psr\Link\EvolvableLinkInterface | | Implements | SerializerInterface |

Class Phalcon\Http\Link\Serializer\Header

Методы

public function serialize( array $links ): string | null;

Serializes all the passed links to a HTTP link header

Interface Phalcon\Html\Link\Serializer\SerializerInterface

Исходный код на GitHub

| Namespace | Phalcon\Html\Link\Serializer |

Class Phalcon\Http\Link\Serializer\SerializerInterface

Методы

public function serialize( array $links ): string | null;

Serializer method

Class Phalcon\Html\TagFactory

Исходный код на GitHub

| Namespace | Phalcon\Html | | Uses | Phalcon\Escaper, Phalcon\Escaper\EscaperInterface, Phalcon\Factory\AbstractFactory | | Extends | AbstractFactory |

ServiceLocator implementation for Tag helpers

Properties

/**
 * @var EscaperInterface
 */
private escaper;

Методы

public function __construct( EscaperInterface $escaper, array $services = [] );

TagFactory constructor.

public function newInstance( string $name ): mixed;
protected function getAdapters(): array;