Secciones

Class Phalcon\Html\Attributes

Código fuente en 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

Métodos

public function __toString(): string;

Alias of the render method

public function render(): string;

Render attributes as HTML attributes

Interface Phalcon\Html\Attributes\AttributesInterface

Código fuente en GitHub

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

Métodos

public function getAttributes(): Attributes;

Get Attributes

public function setAttributes( Attributes $attributes ): AttributesInterface;

Set Attributes

Interface Phalcon\Html\Attributes\RenderInterface

Código fuente en GitHub

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

Métodos

public function render(): string;

Generate a string represetation

Class Phalcon\Html\Breadcrumbs

Código fuente en 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.

Propiedades

/**
 * 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>;

Métodos

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

Código fuente en 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

Código fuente en GitHub

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

Phalcon\Html\Helper\AbstractHelper

Abstract class for all HTML helpers

Propiedades

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

Métodos

public function __construct( EscaperInterface $escaper );

Constructor

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

Keeps all the attributes sorted - same order all the tome

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

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Anchor

Creates an anchor

Métodos

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

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\AnchorRaw

Creates a raw anchor

Métodos

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

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Body

Creates a body tag

Métodos

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

@var array attributes Any additional attributes

Class Phalcon\Html\Helper\Button

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Button

Creates a button tag

Métodos

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

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Close

Creates a closing tag

Métodos

public function __invoke( string $tag ): string;

Class Phalcon\Html\Helper\Element

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Address

Creates an element

Métodos

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

Código fuente en GitHub

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

Phalcon\Html\Helper\ElementRaw

Creates an element raw

Métodos

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

Class Phalcon\Html\Helper\Form

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\Form

Creates a form opening tag

Métodos

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

@var array attributes Any additional attributes

Class Phalcon\Html\Helper\Img

Código fuente en GitHub

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

Phalcon\Html\Helper\Img

Creates am img tag

Métodos

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

Class Phalcon\Html\Helper\Label

Código fuente en GitHub

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

Phalcon\Html\Helper\Label

Creates a label

Métodos

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

Class Phalcon\Html\Helper\TextArea

Código fuente en GitHub

Namespace Phalcon\Html\Helper   Extends AbstractHelper

Phalcon\Html\Helper\TextArea

Creates a textarea tag

Métodos

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\Link\EvolvableLink

Código fuente en 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

Métodos

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 already not present, this method MUST return normally without errors.

Class Phalcon\Html\Link\EvolvableLinkProvider

Código fuente en GitHub

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

Class Phalcon\Http\Link\LinkProvider

@property LinkInterface[] links

Métodos

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

Código fuente en GitHub

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

Class Phalcon\Http\Link\Link

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

Propiedades

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

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

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

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

Métodos

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

Código fuente en GitHub

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

Class Phalcon\Http\Link\LinkProvider

@property LinkInterface[] links

Propiedades

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

Métodos

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

Código fuente en GitHub

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

Class Phalcon\Http\Link\Serializer\Header

Métodos

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

Serializes all the passed links to a HTTP link header

Interface Phalcon\Html\Link\Serializer\SerializerInterface

Código fuente en GitHub

Namespace Phalcon\Html\Link\Serializer

Class Phalcon\Http\Link\Serializer\SerializerInterface

Métodos

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

Serializer method

Class Phalcon\Html\TagFactory

Código fuente en GitHub

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

ServiceLocator implementation for Tag helpers

Propiedades

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

Métodos

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

TagFactory constructor.

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