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 |
Esta clase ayuda a trabajar con atributos HTML
Métodos
public function __toString(): string;
Alias del método render
public function render(): string;
Renderiza atributos como atributos HTML
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;
Obtiene atributos
public function setAttributes( Attributes $attributes ): AttributesInterface;
Establece atributos
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;
Genera una representación de cadena
Class Phalcon\Html\Breadcrumbs
Código fuente en GitHub
Namespace |
Phalcon\Html |
|
Uses |
Phalcon\Di\DiInterface |
Phalcon\Html\Breadcrumbs
Este componente ofrece una forma fácil de crear migas de pan para su aplicación. El HTML resultante cuando llama a render()
tendrá cada miga de pan encerrada en etiquetas <dt>
, mientras que la cadena entera está encerrada en etiquetas <dl>
.
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;
Añade una nueva miga.
// 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;
Limpia las migas
public function getSeparator(): string
public function remove( string $link ): void;
Elimina una miga por url.
$breadcrumbs->remove("/admin/user/create");
// remove a crumb without an url (last link)
$breadcrumbs->remove();
public function render(): string;
Renderiza y muestra las migas de pan basadas en una plantilla configurada previamente.
echo $breadcrumbs->render();
public function setSeparator( string $separator )
public function toArray(): array;
Devuelve el vector de migas de pan interno
Class Phalcon\Html\Exception
Código fuente en GitHub
Namespace |
Phalcon\Html |
|
Extends |
\Phalcon\Exception |
Phalcon\Html\Tag\Exception
Las excepciones lanzadas en Phalcon\Html\Tag usarán esta clase
Abstract Class Phalcon\Html\Helper\AbstractHelper
Código fuente en 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
Propiedades
/**
* @var string
*/
protected delimiter = ;
/**
* @var EscaperInterface
*/
protected escaper;
/**
* @var string
*/
protected indent = ;
/**
* @var int
*/
protected indentLevel = 1;
Métodos
public function __construct( EscaperInterface $escaper );
Constructor AbstractHelper.
protected function close( string $tag, bool $raw = bool ): string;
Produce una etiqueta de cierre
protected function indent(): string;
Replica la sangría x veces según el indentLevel
protected function orderAttributes( array $overrides, array $attributes ): array;
Mantiene todos los atributos ordenados - el mismo orden todo el tomo
protected function renderArrayElements( array $elements, string $delimiter ): string;
Recorre un vector y llama al método definido en el primer elemento con atributos como el segundo, devolviendo la cadena resultante
protected function renderAttributes( array $attributes ): string;
Renderiza todos los atributos
protected function renderElement( string $tag, array $attributes = [] ): string;
Renderiza un elemento
protected function renderFullElement( string $tag, string $text, array $attributes = [], bool $raw = bool ): string;
Renderiza un elemento
protected function renderTag( string $tag, array $attributes = [], string $close = string ): string;
Renderiza una etiqueta
protected function selfClose( string $tag, array $attributes = [] ): string;
Produce una etiqueta de autocierre i.e. ![]()
Abstract Class Phalcon\Html\Helper\AbstractList
Código fuente en GitHub
Namespace |
Phalcon\Html\Helper |
|
Uses |
Phalcon\Html\Exception |
|
Extends |
AbstractHelper |
Class AbstractList
Propiedades
/**
* @var array
*/
protected attributes;
/**
* @var string
*/
protected elementTag = li;
/**
* @var array
*/
protected store;
Métodos
public function __invoke( string $indent = null, string $delimiter = null, array $attributes = [] ): AbstractList;
public function __toString();
Genera y devuelve el HTML para la lista.
abstract protected function getTag(): string;
Devuelve el nombre de etiqueta.
Abstract Class Phalcon\Html\Helper\AbstractSeries
Código fuente en GitHub
Namespace |
Phalcon\Html\Helper |
|
Extends |
AbstractHelper |
Class AbstractSeries
Propiedades
/**
* @var array
*/
protected attributes;
/**
* @var array
*/
protected store;
Métodos
public function __invoke( string $indent = null, string $delimiter = null ): AbstractSeries;
public function __toString();
Genera y devuelve el HTML para la lista.
abstract protected function getTag(): string;
Devuelve el nombre de etiqueta.
Class Phalcon\Html\Helper\Anchor
Código fuente en GitHub
Namespace |
Phalcon\Html\Helper |
|
Uses |
Phalcon\Html\Exception |
|
Extends |
AbstractHelper |
Class Anchor
Métodos
public function __invoke( string $href, string $text, array $attributes = [], bool $raw = bool ): string;
Produce una etiqueta </p>
protected function processAttributes( string $href, array $attributes ): array;
Class Phalcon\Html\Helper\Base
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Base
Métodos
public function __invoke( string $href = null, array $attributes = [] ): string;
Produce una etiqueta <base/>
.
Class Phalcon\Html\Helper\Body
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Body
Métodos
public function __invoke( array $attributes = [] ): string;
Produce una etiqueta <body>
.
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Button
Métodos
public function __invoke( string $text, array $attributes = [], bool $raw = bool ): string;
Produce una etiqueta <button>
.
Class Phalcon\Html\Helper\Close
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Extends | AbstractHelper |
Class Close
Métodos
public function __invoke( string $tag, bool $raw = bool ): string;
Produce una etiqueta </...>
.
Class Phalcon\Html\Helper\Element
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Element
Métodos
public function __invoke( string $tag, string $text, array $attributes = [], bool $raw = bool ): string;
Produce una etiqueta.
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Form
Métodos
public function __invoke( array $attributes = [] ): string;
Produce una etiqueta <form>
.
Class Phalcon\Html\Helper\Img
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Img
Métodos
public function __invoke( string $src, array $attributes = [] ): string;
Produce una etiqueta
.
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Html\Helper\AbstractHelper | | Extends | AbstractHelper |
Class AbstractInput
@property array $attributes @property string $type @property string $value
Propiedades
/**
* @var string
*/
protected type = text;
/**
* @var array
*/
protected attributes;
Métodos
public function __invoke( string $name, string $value = null, array $attributes = [] ): AbstractInput;
public function __toString();
Devuelve el HTML para la entrada.
public function setValue( string $value = null ): AbstractInput;
Establece el valor del elemento
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Escaper\EscaperInterface, Phalcon\Helper\Arr | | Extends | AbstractInput |
Class Checkbox
@property array $label
Propiedades
/**
* @var array
*/
protected label;
/**
* @var string
*/
protected type = checkbox;
Métodos
public function __construct( EscaperInterface $escaper );
Constructor AbstractHelper.
public function __toString();
Devuelve el HTML para la entrada.
public function label( array $attributes = [] ): Checkbox;
Adjunta una etiqueta al elemento
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Color
Propiedades
//
protected type = color;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Date
Propiedades
//
protected type = date;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class DateTime
Propiedades
//
protected type = datetime;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class DateTimeLocal
Propiedades
//
protected type = datetime-local;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Email
Propiedades
//
protected type = email;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class File
Propiedades
//
protected type = file;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Hidden
Propiedades
//
protected type = hidden;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Image
Propiedades
//
protected type = image;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Input
Métodos
public function setType( string $type ): AbstractInput;
Establece el tipo de entrada
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Month
Propiedades
//
protected type = month;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Numeric
Propiedades
//
protected type = numeric;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Password
Propiedades
//
protected type = password;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | Checkbox |
Class Radio
Propiedades
/**
* @var string
*/
protected type = radio;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Range
Propiedades
//
protected type = range;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Search
Propiedades
//
protected type = search;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Html\Helper\AbstractList | | Extends | AbstractList |
Clase Select
@property string $elementTag @property bool $inOptGroup @property string $selected
Propiedades
/**
* @var string
*/
protected elementTag = option;
/**
* @var bool
*/
protected inOptGroup = false;
/**
* @var string
*/
protected selected = ;
Métodos
public function add( string $text, string $value = null, array $attributes = [], bool $raw = bool ): Select;
Añade un elemento a la lista
public function addPlaceholder( string $text, mixed $value = null, array $attributes = [], bool $raw = bool ): Select;
Añade un elemento a la lista
public function optGroup( string $label = null, array $attributes = [] ): Select;
Crea un grupo de opciones
public function selected( string $selected ): Select;
protected function getTag(): string;
protected function optGroupEnd(): string;
protected function optGroupStart( string $label, array $attributes ): string;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Submit
Propiedades
//
protected type = submit;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Tel
Propiedades
//
protected type = tel;
Class Phalcon\Html\Helper\Input\Text
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Text
Class Phalcon\Html\Helper\Input\Textarea
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Uses | Phalcon\Helper\Arr, Phalcon\Html\Exception | | Extends | AbstractInput |
Class Textarea
Propiedades
/**
* @var string
*/
protected type = textarea;
Métodos
public function __toString();
Devuelve el HTML para la entrada.
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Time
Propiedades
//
protected type = time;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Url
Propiedades
//
protected type = url;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper\Input | | Extends | AbstractInput |
Class Week
Propiedades
//
protected type = week;
Class Phalcon\Html\Helper\Label
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractHelper |
Class Label
Métodos
public function __invoke( array $attributes = [] ): string;
Produce una etiqueta <label>
.
Class Phalcon\Html\Helper\Link
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Extends | AbstractSeries |
Class Link
Métodos
public function add( string $rel, string $href ): Link;
Añade un elemento a la lista
protected function getTag(): string;
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractSeries |
Class Meta
Métodos
public function add( array $attributes = [] ): Meta;
Añade un elemento a la lista
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
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Extends | AbstractList |
Class Ol
Métodos
public function add( string $text, array $attributes = [], bool $raw = bool ): AbstractList;
Añade un elemento a la lista
protected function getTag(): string;
Class Phalcon\Html\Helper\Script
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Extends | Style |
Class Script
Métodos
protected function getAttributes( string $src, array $attributes ): array;
Devuelve los atributos necesarios
protected function getTag(): string;
Class Phalcon\Html\Helper\Style
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Uses | Phalcon\Html\Exception | | Extends | AbstractSeries |
Class Style
Métodos
public function add( string $href, array $attributes = [] );
Añade un elemento a la lista
protected function getAttributes( string $href, array $attributes ): array;
Devuelve los atributos necesarios
protected function getTag(): string;
Class Phalcon\Html\Helper\Title
Código fuente en 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
Propiedades
/**
* @var array
*/
protected append;
/**
* @var array
*/
protected prepend;
/**
* @var string
*/
protected title = ;
/**
* @var string
*/
protected separator = ;
Métodos
public function __invoke( string $separator = string, string $indent = null, string $delimiter = null ): Title;
Establece el separador y devuelve el objeto de vuelta
public function __toString();
Devuelve las etiquetas de título
public function append( string $text, bool $raw = bool ): Title;
Añade texto al título de documento actual
public function get(): string;
Devuelve el título
public function prepend( string $text, bool $raw = bool ): Title;
Antepone texto al título de documento actual
public function set( string $text, bool $raw = bool ): Title;
Establece el título
Class Phalcon\Html\Helper\Ul
Código fuente en GitHub
| Namespace | Phalcon\Html\Helper | | Extends | Ol |
Class Ul
Métodos
protected function getTag(): string;
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 );
Devuelve una instancia con el atributo especificado añadido.
Si el atributo especificado ya está presente, se sobreescribirá con el nuevo valor.
public function withHref( mixed $href );
Devuelve una instancia con el href
especificado.
public function withRel( mixed $rel );
Devuelve una instancia con la relación especificada incluida.
Si el rel
especificado ya está presente, este método DEBE devolver normalmente sin errores, pero sin añadir el rel
una segunda vez.
public function withoutAttribute( mixed $attribute );
Devuelve una instancia con el atributo especificado excluido.
Si el atributo especificado no está presente, este método DEBE devolver normalmente sin errores.
public function withoutRel( mixed $rel );
Devuelve una instancia con la relación especificada excluida.
Si el rel
especificado no está presente, este método DEBE devolver normalmente sin errores.
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 );
Devuelve una instancia con el enlace especificado incluido.
Si el enlace especificado ya está presente, este método DEBE devolver normalmente sin errores. El enlace está presente si enlace es === idéntico al objeto enlace presente en la colección.
public function withoutLink( LinkInterface $link );
Devuelve una instancia con el enlace especificado eliminado.
Si el enlace especificado no está presente, este método DEBE devolver normalmente sin errores. El enlace está presente si enlace es === idéntico al objeto enlace presente en la colección.
Class Phalcon\Html\Link\Link
Código fuente en 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
Propiedades
/**
* @var Collection|CollectionInterface
*/
protected attributes;
/**
* @var string
*/
protected href = ;
/**
* @var Collection|CollectionInterface
*/
protected rels;
/**
* @var bool
*/
protected templated = false;
Métodos
public function __construct( string $rel = string, string $href = string, array $attributes = [] );
Constructor Link.
public function getAttributes();
Devuelve una lista de atributos que describen la URI de destino.
public function getHref();
Devuelve el destino del enlace.
El enlace destino debe ser uno de:
-
Una URI absoluta, definida en RFC 5988.
-
Una URI relativa, definida en RFC 5988. La base del enlace relativo es conocida basada en el contexto del cliente.
-
Una plantilla de URI, definida en RFC 6570.
Si se devuelve una plantilla URI, isTemplated() DEBE devolver True
.
public function getRels();
Devuelve el/los tipo/s de relación del enlace.
Este método devuelve 0 o más tipos de relación para un enlace, expresado como un vector de cadenas.
public function isTemplated();
Devuelve si este es un enlace de plantilla o no.
protected function hrefIsTemplated( string $href ): bool;
Determina si un href
es un enlace de plantilla o no.
@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 = [] );
Constructor LinkProvider.
public function getLinks();
Devuelve un iterable de objetos LinkInterface.
El iterable puede ser un vector o cualquier objeto \Traversable
de PHP. Si no hay enlaces disponibles, se DEBE devolver un vector vacío o \Travesable
.
public function getLinksByRel( mixed $rel );
Devuelve un iterable de objetos LinkInterface
que tienen una relación específica.
El iterable puede ser un vector o cualquier objeto \Traversable
de PHP. Si no hay enlaces disponibles con esa relación, se DEBE devolver un vector vacío o \Traversable
.
protected function getKey( LinkInterface $link ): string;
Devuelve la clave hash del objeto
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;
Serializa todos los enlaces pasados a una cabecera de enlace HTTP
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;
Método serializador
Class Phalcon\Html\TagFactory
Código fuente en GitHub
| Namespace | Phalcon\Html | | Uses | Phalcon\Escaper, Phalcon\Escaper\EscaperInterface, Phalcon\Factory\AbstractFactory | | Extends | AbstractFactory |
Implementación de ServiceLocator para ayudantes Tag
Propiedades
/**
* @var EscaperInterface
*/
private escaper;
Métodos
public function __construct( EscaperInterface $escaper, array $services = [] );
Constructor TagFactory.
public function newInstance( string $name ): mixed;
protected function getAdapters(): array;