Sections

Class Phalcon\Html\Attributes

Source on 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

Methods

public function __toString(): string;

Alias of the render method

public function render(): string;

Render attributes as HTML attributes

Interface Phalcon\Html\Attributes\AttributesInterface

Source on GitHub

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

Methods

public function getAttributes(): Attributes;

Get Attributes

public function setAttributes( Attributes $attributes ): AttributesInterface;

Set Attributes

Interface Phalcon\Html\Attributes\RenderInterface

Source on GitHub

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

Methods

public function render(): string;

Generate a string represetation

Class Phalcon\Html\Breadcrumbs

Source on 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>;

Methods

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

Source on 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

Source on GitHub

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

Phalcon\Html\Helper\AbstractHelper

Abstract class for all html helpers

Properties

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

Methods

public function __construct( EscaperInterface $escaper );

Constructor

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

Keeps all the attributes sorted - same order all the tome

@return array

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 selfClose( string $tag, array $attributes = [] ): string;

Produces a self close tag i.e.

Class Phalcon\Html\Helper\Anchor

Source on GitHub

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

Phalcon\Html\Helper\Anchor

Creates an anchor

Methods

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

@var string href The href tag @var string text The text for the anchor @var array attributes Any additional attributes

Class Phalcon\Html\Helper\AnchorRaw

Source on GitHub

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

Phalcon\Html\Helper\AnchorRaw

Creates a raw anchor

Methods

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

@var string href The href tag @var string text The text for the anchor @var array attributes Any additional attributes

Class Phalcon\Html\Helper\Body

Source on GitHub

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

Phalcon\Html\Helper\Body

Creates a body tag

Methods

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

@var array attributes Any additional attributes

Class Phalcon\Html\Helper\Button

Source on GitHub

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

Phalcon\Html\Helper\Button

Creates a button tag

Methods

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

@var string text The text for the anchor @var array attributes Any additional attributes

Class Phalcon\Html\Helper\Close

Source on GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Close

Creates a closing tag

Methods

public function __invoke( string $tag ): string;

@return string

Class Phalcon\Html\Helper\Element

Source on GitHub

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

Phalcon\Html\Helper\Address

Creates an element

Methods

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

@var string tag The tag name @var string text The text for the anchor @var array attributes Any additional attributes

Class Phalcon\Html\Helper\ElementRaw

Source on GitHub

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

Phalcon\Html\Helper\ElementRaw

Creates an element raw

Methods

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

@return string @throws Exception

Class Phalcon\Html\Helper\Form

Source on GitHub

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

Phalcon\Html\Helper\Form

Creates a form opening tag

Methods

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

@var array attributes Any additional attributes

Class Phalcon\Html\Helper\Img

Source on GitHub

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

Phalcon\Html\Helper\Img

Creates am img tag

Methods

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

@return string @throws Exception

Class Phalcon\Html\Helper\Label

Source on GitHub

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

Phalcon\Html\Helper\Label

Creates a label

Methods

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

@return string @throws Exception

Class Phalcon\Html\Helper\TextArea

Source on GitHub

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

Phalcon\Html\Helper\TextArea

Creates a textarea tag

Methods

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

@var string text The text for the anchor @var array attributes Any additional attributes

Class Phalcon\Html\TagFactory

Source on 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;

Methods

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

TagFactory constructor.

public function newInstance( string $name ): mixed;

@return mixed @throws Exception

protected function getAdapters(): array;

//