Phalcon html
注意
所有类都以前缀命名Phalcon
Html\Attributes¶
-
命名空间
Phalcon\Html
-
使用
Phalcon\Html\Attributes\RenderInterface
Phalcon\Support\Collection
-
继承
Collection
-
实现
RenderInterface
该类有助于处理 HTML 属性
方法¶
render 方法的别名 将属性渲染为 HTML 属性 @todo 当我们重构表单时移除该类。可能直接删除此类?将其放入 traits 中Html\Attributes\AttributesInterface
¶
-
命名空间
Phalcon\Html\Attributes
-
使用
Phalcon\Html\Attributes
-
继承
-
实现
-
Phalcon\Html\Attributes\AttributesInterface *
- 接口 Phalcon\Html\Attributes\AttributesInterface */
方法¶
获取属性 设置属性Html\Attributes\RenderInterface
¶
-
命名空间
Phalcon\Html\Attributes
-
使用
-
继承
-
实现
-
Phalcon\Html\Attributes\RenderInterface *
- 接口 Phalcon\Html\Attributes\RenderInterface */
方法¶
生成字符串表示Html\Breadcrumbs¶
-
命名空间
Phalcon\Html
-
使用
Phalcon\Di\DiInterface
-
继承
-
实现
Phalcon\Html\Breadcrumbs
此组件提供了一种简便的方式来为您的应用程序创建面包屑导航。在调用时生成的 HTML 为:render()
将每个面包屑包含在<dt>
标签中,而整个字符串则包含在<dl>
标签中。
@deprecated 将在未来的版本中移除,请使用 {@see Phalcon\Html\Helper\Breadcrumbs} 替代。
属性¶
/**
* 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>;
方法¶
添加一个新的面包屑。// Adding a crumb with a link
$breadcrumbs->add("Home", "/");
// Adding a crumb without a link (normally the last one)
$breadcrumbs->add("Users");
$breadcrumbs->remove("/admin/user/create");
// remove a crumb without an url (last link)
$breadcrumbs->remove();
Html\Escaper¶
-
命名空间
Phalcon\Html
-
使用
Phalcon\Html\Escaper\EscaperInterface
-
继承
-
实现
EscaperInterface
Phalcon\Html\Escaper
对不同种类的文本进行转义以确保其安全。通过使用此组件,您可以防止 XSS 攻击。
此组件仅适用于 UTF-8 编码。PREG 扩展需要编译支持 UTF-8。
$escaper = new \Phalcon\Html\Escaper();
$escaped = $escaper->escapeCss("font-family: <Verdana>");
echo $escaped; // font\2D family\3A \20 \3C Verdana\3E
属性¶
/**
* @var bool
*/
protected $doubleEncode = true;
/**
* @var string
*/
protected $encoding = utf-8;
/**
* ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
*
* @var int
*/
protected $flags = 11;
方法¶
转义 HTML 属性字符串或数组如果输入是一个数组,键是属性名,值是属性值。如果某个值为布尔值 (true/false),则属性将没有值:['disabled' => true]
-> `'disabled``
结果字符串中的属性对将以空格分隔。
通过将非字母数字字符替换为其十六进制转义表示来转义 CSS 字符串 检测字符串的字符编码,以便由编码器处理。对于 mb_detect_encoding() 无法检测到的 chr(172) 和 chr(128) 到 chr(159) 进行特殊处理。 通过将非字母数字字符替换为其十六进制转义表示来转义 CSS 字符串 转义 HTML 字符串。内部使用 htmlspecialchars 转义 HTML 属性字符串 通过将非字母数字字符替换为其十六进制转义表示来转义 JavaScript 字符串 转义 URL。内部使用 rawurlencode 转义 HTML 字符串。内部使用 htmlspecialchars 转义 javascript 字符串,通过将非字母数字字符替换为其十六进制转义表示 工具方法,用于将字符串的编码规范化为 UTF-32。 设置转义器使用的 double_encode 值 设置转义器使用的编码 设置 htmlspecialchars 的 HTML 引号类型 设置 htmlspecialchars 的 HTML 引号类型 转义 URL。内部使用 rawurlencode 测试用代理方法Html\Escaper\EscaperInterface
¶
-
命名空间
Phalcon\Html\Escaper
-
使用
-
继承
-
实现
Phalcon\Html\Escaper 的接口定义
方法¶
转义 HTML 属性字符串 通过将非字母数字字符替换为其十六进制表示来转义 CSS 字符串 返回转义器使用的内部编码 转义 HTML 字符串 通过将非字母数字字符替换为其十六进制表示来转义 JavaScript 字符串 设置转义器使用的编码 设置 htmlspecialchars 的 HTML 引号类型 转义 URL。内部使用 rawurlencodeHtml\Escaper\Exception¶
-
命名空间
Phalcon\Html\Escaper
-
使用
-
继承
\Exception
-
实现
Phalcon\Html\Escaper 中抛出的异常会使用此类
Html\EscaperFactory¶
-
命名空间
Phalcon\Html
-
使用
-
继承
-
实现
EscaperFactory 类
方法¶
创建一个对象的新实例Html\Exception¶
-
命名空间
Phalcon\Html
-
使用
-
继承
\Exception
-
实现
Phalcon\Html\Tag\Exception
Phalcon\Html\Tag 中抛出的异常将使用此类
Html\Helper\AbstractHelper
¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Escaper\EscaperInterface
Phalcon\Html\Exception
-
继承
-
实现
@property string $delimiter @property EscaperInterface $escaper @property string $indent @property int $indentLevel
属性¶
/**
* @var string
*/
protected $delimiter = ;
/**
* @var EscaperInterface
*/
protected $escaper;
/**
* @var string
*/
protected $indent = ;
/**
* @var int
*/
protected $indentLevel = 1;
方法¶
抽象帮助器构造函数。 生成一个闭合标签 按照 indentLevel 复制缩进 x 次 保持所有属性排序 - 始终保持相同的顺序 遍历数组并调用第一个元素中定义的方法,第二个元素作为参数,返回结果字符串 渲染所有属性 渲染一个元素protected function renderFullElement( string $tag, string $text, array $attributes = [], bool $raw = bool ): string;
protected function renderTag( string $tag, array $attributes = [], string $close = string ): string;
Html\Helper\AbstractList
¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 AbstractList
属性¶
/**
* @var array
*/
protected $attributes;
/**
* @var string
*/
protected $elementTag = li;
/**
* @var array
*/
protected $store;
方法¶
public function __invoke( string $indent = string, string $delimiter = null, array $attributes = [] ): AbstractList;
Html\Helper\AbstractSeries
¶
-
命名空间
Phalcon\Html\Helper
-
使用
-
继承
AbstractHelper
-
实现
@property array $attributes @property array $store
属性¶
方法¶
生成并返回列表的 HTML。 重置内部存储。 返回标签名称。Html\Helper\Anchor¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Anchor
方法¶
public function __invoke( string $href, string $text, array $attributes = [], bool $raw = bool ): string;
Html\Helper\Base¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Base
方法¶
生成一个<base/>
tag. Html\Helper\Body¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Body
方法¶
生成一个<body>
tag. Html\Helper\Breadcrumbs¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Escaper\EscaperInterface
Phalcon\Support\Helper\Str\Interpolate
-
继承
AbstractHelper
-
实现
此组件提供了一种简便的方式来为您的应用程序创建面包屑导航。在调用时生成的 HTML 为:render()
将每个面包屑包含在<li>
标签中,而整个字符串则包含在<nav>
和<ol>
标签中。
@phpstan-type TTemplate = array{ main: string, line: string, last: string, } @phpstan-type TElement = array{ attributes: array
属性¶
/**
* @var array<string, string>
*/
private $attributes;
/**
* Keeps all the breadcrumbs.
*
* @var array<int, TElement>
*/
private $data;
/**
* Crumb separator.
*
* @var string
*/
private $separator = <li>/</li>;
/**
* The HTML template to use to render the breadcrumbs.
*
* @var TTemplate
*/
private $template;
/**
* The HTML template to use to render the breadcrumbs.
*
* @var Interpolate
*/
private $interpolator;
方法¶
抽象帮助器构造函数。 设置缩进和分隔符,并返回对象本身。public function add( string $text, string $link = string, string $icon = string, array $attributes = [] ): Breadcrumbs;
// Adding a crumb with a link
$breadcrumbs->add("Home", "/");
// Adding a crumb with added attributes
$breadcrumbs->add("Home", "/", ["class" => "main"]);
// Adding a crumb without a link (normally the last one)
$breadcrumbs->add("Users");
Html\Helper\Button¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Button
方法¶
生成一个<button>
tag. Html\Helper\Close¶
-
命名空间
Phalcon\Html\Helper
-
使用
-
继承
AbstractHelper
-
实现
类 Close
方法¶
生成一个</...>
tag. Html\Helper\Doctype¶
-
命名空间
Phalcon\Html\Helper
-
使用
-
继承
-
实现
创建 Doctype 标签
常量¶
const HTML32 = 1;
const HTML401_FRAMESET = 4;
const HTML401_STRICT = 2;
const HTML401_TRANSITIONAL = 3;
const HTML5 = 5;
const XHTML10_FRAMESET = 8;
const XHTML10_STRICT = 6;
const XHTML10_TRANSITIONAL = 7;
const XHTML11 = 9;
const XHTML20 = 10;
const XHTML5 = 11;
属性¶
方法¶
public function __invoke( int $flag = static-constant-access, string $delimiter = string ): Doctype;
Html\Helper\Element¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Element
方法¶
public function __invoke( string $tag, string $text, array $attributes = [], bool $raw = bool ): string;
Html\Helper\Form¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Form
方法¶
生成一个<form>
tag. Html\Helper\Img¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Img
方法¶
生成一个Html\Helper\Input\AbstractInput
¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
Phalcon\Html\Helper\AbstractHelper
-
继承
AbstractHelper
-
实现
类 AbstractInput
@property array $attributes @property string $type @property string $value
属性¶
方法¶
public function __invoke( string $name, string $value = null, array $attributes = [] ): AbstractInput;
Html\Helper\Input\Checkbox¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
Phalcon\Html\Escaper\EscaperInterface
-
继承
AbstractInput
-
实现
类 Checkbox
@property array $label
属性¶
方法¶
抽象帮助器构造函数。 返回输入元素的 HTML。 将标签附加到元素上Html\Helper\Input\Color¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Color
属性¶
Html\Helper\Input\Date¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Date
属性¶
Html\Helper\Input\DateTime¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 DateTime
属性¶
Html\Helper\Input\DateTimeLocal¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 DateTimeLocal
属性¶
Html\Helper\Input\Email¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Email
属性¶
Html\Helper\Input\File¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 File
属性¶
Html\Helper\Input\Hidden¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Hidden
属性¶
Html\Helper\Input\Image¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Image
属性¶
Html\Helper\Input\Input¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Input
方法¶
设置输入元素的类型Html\Helper\Input\Month¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Month
属性¶
Html\Helper\Input\Numeric¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Numeric
属性¶
Html\Helper\Input\Password¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Password
属性¶
Html\Helper\Input\Radio¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
Checkbox
-
实现
类 Radio
属性¶
Html\Helper\Input\Range¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Range
属性¶
Html\Helper\Input\Search¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Search
属性¶
Html\Helper\Input\Select¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
Phalcon\Html\Helper\AbstractList
-
继承
AbstractList
-
实现
类 Select
属性¶
/**
* @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;
public function addPlaceholder( string $text, mixed $value = null, array $attributes = [], bool $raw = bool ): Select;
Html\Helper\Input\Submit¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Submit
属性¶
Html\Helper\Input\Tel¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Tel
属性¶
Html\Helper\Input\Text¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Text
Html\Helper\Input\Textarea¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
Phalcon\Html\Exception
-
继承
AbstractInput
-
实现
类 Textarea
属性¶
方法¶
返回输入元素的 HTML。Html\Helper\Input\Time¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Time
属性¶
Html\Helper\Input\Url¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Url
属性¶
Html\Helper\Input\Week¶
-
命名空间
Phalcon\Html\Helper\Input
-
使用
-
继承
AbstractInput
-
实现
类 Week
属性¶
Html\Helper\Label¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Label
方法¶
生成一个<label>
tag. Html\Helper\Link¶
-
命名空间
Phalcon\Html\Helper
-
使用
-
继承
Style
-
实现
创建标签
方法¶
向列表中添加一个元素 返回必要的属性Html\Helper\Meta¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractSeries
-
实现
类 Meta
方法¶
向列表中添加一个元素Html\Helper\Ol¶
-
命名空间
Phalcon\Html\Helper
-
使用
-
继承
AbstractList
-
实现
类 Ol
方法¶
向列表中添加一个元素Html\Helper\Script¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractSeries
-
实现
类 Script
方法¶
向列表中添加一个元素 返回必要的属性Html\Helper\Style¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractSeries
-
实现
类 Style
属性¶
方法¶
向列表中添加一个元素 设置这是 style 还是 link 标签 返回必要的属性Html\Helper\Title¶
-
命名空间
Phalcon\Html\Helper
-
使用
Phalcon\Html\Exception
-
继承
AbstractHelper
-
实现
类 Title
@property array $append @property string $delimiter @property string $indent @property array $prepend @property string $title @property string $separator
属性¶
/**
* @var array
*/
protected $append;
/**
* @var array
*/
protected $prepend;
/**
* @var string
*/
protected $title = ;
/**
* @var string
*/
protected $separator = ;
方法¶
设置分隔符并返回对象本身 返回标题标签 将文本追加到当前文档标题 返回标题 将文本前置到当前文档标题 设置标题 设置分隔符Html\Helper\Ul¶
-
命名空间
Phalcon\Html\Helper
-
使用
-
继承
Ol
-
实现
类 Ul
方法¶
Html\Link\AbstractLink
¶
-
命名空间
Phalcon\Html\Link
-
使用
Phalcon\Support\Collection
-
继承
-
实现
@property array $attributes @property string $href @property array $rels @property bool $templated
属性¶
/**
* @var Collection
*/
protected $attributes;
/**
* @var string
*/
protected $href = ;
/**
* @var Collection
*/
protected $rels;
/**
* @var bool
*/
protected $templated = false;
方法¶
链接构造函数。 返回描述目标URI的一组属性。 返回链接的目标。目标链接必须是以下之一: - 根据RFC 5988定义的绝对URI。 - 根据RFC 5988定义的相对URI。客户端假定知道相对链接的基准地址基于上下文。 - 根据RFC 6570定义的URI模板。
如果返回的是URI模板,则isTemplated()必须返回True。
返回链接的关系类型。此方法返回一个或多个表示链接关系类型的字符串数组。
返回是否为模板链接。 判断 href 是否为模板化链接。@参见 https://tools.ietf.org/html/rfc6570
Html\Link\AbstractLinkProvider
¶
-
命名空间
Phalcon\Html\Link
-
使用
Phalcon\Html\Link\Interfaces\LinkInterface
-
继承
-
实现
@property array $links
属性¶
方法¶
LinkProvider 构造函数。 返回一个LinkInterface对象的可迭代对象。可迭代对象可以是一个数组或者任何PHP \Traversable对象。如果没有可用的链接,必须返回一个空数组或\Traversable。
返回一个具有特定关系的LinkInterface对象的可迭代对象。可迭代对象可以是一个数组或者任何PHP \Traversable对象。如果没有对应关系的链接,必须返回一个空数组或\Traversable。
返回一个包含了指定链接的实例。如果指定的链接已存在,此方法必须正常返回而不报错。当$link与集合中已有的链接对象完全相同(===)时,表示该链接存在。
返回一个移除了指定链接的实例。如果指定的链接不存在,此方法必须正常返回而不报错。当$link与集合中已有的链接对象完全相同(===)时,表示该链接存在。
返回对象的哈希键Html\Link\EvolvableLink¶
-
命名空间
Phalcon\Html\Link
-
使用
Phalcon\Html\Link\Interfaces\EvolvableLinkInterface
-
继承
Link
-
实现
EvolvableLinkInterface
类 Phalcon\Http\Link\EvolvableLink
@property 数组 attributes @property 字符串 href @property 数组 rels @property 布尔值 templated
方法¶
返回一个添加了指定属性的实例。如果指定的属性已经存在,则会被新值覆盖。
返回一个设置了指定href的实例。 返回一个包含指定关系的实例。如果指定的关系已存在,此方法必须正常返回而不报错,但不会再次添加该关系。
返回一个去除了指定属性的实例。如果指定的属性不存在,此方法必须正常返回而不报错。
返回一个去除了指定关系的实例。如果指定的关系不存在,此方法必须正常返回而不报错。
Html\Link\EvolvableLinkProvider¶
-
命名空间
Phalcon\Html\Link
-
使用
Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface
Phalcon\Html\Link\Interfaces\LinkInterface
-
继承
LinkProvider
-
实现
EvolvableLinkProviderInterface
类 Phalcon\Http\Link\LinkProvider
@property LinkInterface[] links
方法¶
返回一个包含了指定链接的实例。如果指定的链接已存在,此方法必须正常返回而不报错。当$link与集合中已有的链接对象完全相同(===)时,表示该链接存在。
返回一个移除了指定链接的实例。如果指定的链接不存在,此方法必须正常返回而不报错。当link与集合中已有的链接对象完全相同(===)时,表示该链接存在。
Html\Link\Interfaces\EvolvableLinkInterface
¶
-
命名空间
Phalcon\Html\Link\Interfaces
-
使用
-
继承
LinkInterface
-
实现
一个可变链接值对象。
方法¶
返回一个添加了指定属性的实例。如果指定的属性已经存在,则会被新值覆盖。
返回一个设置了指定href的实例。 返回一个包含指定关系的实例。如果指定的关系已存在,此方法必须正常返回而不报错,但不会再次添加该关系。
返回一个去除了指定属性的实例。如果指定的属性不存在,此方法必须正常返回而不报错。
返回一个去除了指定关系的实例。如果指定的关系本来就不在其中,此方法必须正常返回而不报错。
Html\Link\Interfaces\EvolvableLinkProviderInterface
¶
-
命名空间
Phalcon\Html\Link\Interfaces
-
使用
-
继承
LinkProviderInterface
-
实现
一个可变链接提供者值对象。
方法¶
返回一个包含了指定链接的实例。如果指定的链接已存在,此方法必须正常返回而不报错。当$link与集合中已有的链接对象完全相同(===)时,表示该链接存在。
返回一个移除了指定链接的实例。如果指定的链接不存在,此方法必须正常返回而不报错。当$link与集合中已有的链接对象完全相同(===)时,表示该链接存在。
Html\Link\Interfaces\LinkInterface
¶
-
命名空间
Phalcon\Html\Link\Interfaces
-
使用
-
继承
-
实现
一个可读的链接对象。
方法¶
返回描述目标URI的一组属性。 返回链接的目标。目标链接必须是以下之一: - 根据RFC 5988定义的绝对URI。 - 根据RFC 5988定义的相对URI。客户端假定知道相对链接的基准地址基于上下文。 - 根据RFC 6570定义的URI模板。
如果返回的是URI模板,则isTemplated()必须返回True。
返回链接的关系类型。此方法返回一个或多个表示链接关系类型的字符串数组。
返回是否为模板链接。Html\Link\Interfaces\LinkProviderInterface
¶
-
命名空间
Phalcon\Html\Link\Interfaces
-
使用
-
继承
-
实现
一个链接提供者对象。
方法¶
返回一组LinkInterface对象的数组。 返回具有特定关系的LinkInterface对象数组。Html\Link\Link¶
-
命名空间
Phalcon\Html\Link
-
使用
Phalcon\Html\Link\Interfaces\LinkInterface
Phalcon\Support\Collection
Phalcon\Support\Collection\CollectionInterface
-
继承
AbstractLink
-
实现
LinkInterface
类 Phalcon\Http\Link\Link
@property 数组 attributes @property 字符串 href @property 数组 rels @property 布尔值 templated
方法¶
返回描述目标URI的一组属性。 返回链接的目标。目标链接必须是以下之一: - 根据RFC 5988定义的绝对URI。 - 根据RFC 5988定义的相对URI。客户端假定知道相对链接的基准地址基于上下文。 - 根据RFC 6570定义的URI模板。
如果返回的是URI模板,则isTemplated()必须返回True。
返回链接的关系类型。此方法返回一个或多个表示链接关系类型的字符串数组。
返回是否为模板链接。Html\Link\LinkProvider¶
-
命名空间
Phalcon\Html\Link
-
使用
Phalcon\Html\Link\Interfaces\LinkInterface
Phalcon\Html\Link\Interfaces\LinkProviderInterface
-
继承
AbstractLinkProvider
-
实现
LinkProviderInterface
@property LinkInterface[] links
方法¶
返回一个LinkInterface对象的可迭代对象。可迭代对象可以是一个数组或者任何PHP \Traversable对象。如果没有可用的链接,必须返回一个空数组或\Traversable。
返回一个具有特定关系的LinkInterface对象的可迭代对象。可迭代对象可以是一个数组或者任何PHP \Traversable对象。如果没有对应关系的链接,必须返回一个空数组或\Traversable。
Html\Link\Serializer\Header¶
-
命名空间
Phalcon\Html\Link\Serializer
-
使用
-
继承
-
实现
SerializerInterface
类 Phalcon\Http\Link\Serializer\Header
方法¶
将所有传入的链接序列化为HTTP链接头Html\Link\Serializer\SerializerInterface
¶
-
命名空间
Phalcon\Html\Link\Serializer
-
使用
-
继承
-
实现
类 Phalcon\Http\Link\Serializer\SerializerInterface
方法¶
序列化器方法Html\TagFactory¶
-
命名空间
Phalcon\Html
-
使用
Phalcon\Factory\AbstractFactory
Phalcon\Html\Escaper\EscaperInterface
Phalcon\Html\Helper\Breadcrumbs
Phalcon\Html\Helper\Doctype
Phalcon\Html\Helper\Input\Checkbox
Phalcon\Html\Helper\Input\Color
Phalcon\Html\Helper\Input\Date
Phalcon\Html\Helper\Input\DateTime
Phalcon\Html\Helper\Input\DateTimeLocal
Phalcon\Html\Helper\Input\Email
Phalcon\Html\Helper\Input\File
Phalcon\Html\Helper\Input\Hidden
Phalcon\Html\Helper\Input\Image
Phalcon\Html\Helper\Input\Input
Phalcon\Html\Helper\Input\Month
Phalcon\Html\Helper\Input\Numeric
Phalcon\Html\Helper\Input\Password
Phalcon\Html\Helper\Input\Radio
Phalcon\Html\Helper\Input\Range
Phalcon\Html\Helper\Input\Search
Phalcon\Html\Helper\Input\Select
Phalcon\Html\Helper\Input\Submit
Phalcon\Html\Helper\Input\Tel
Phalcon\Html\Helper\Input\Text
Phalcon\Html\Helper\Input\Textarea
Phalcon\Html\Helper\Input\Time
Phalcon\Html\Helper\Input\Url
Phalcon\Html\Helper\Input\Week
Phalcon\Html\Helper\Meta
Phalcon\Html\Helper\Ol
Phalcon\Html\Helper\Script
Phalcon\Html\Helper\Style
Phalcon\Html\Helper\Title
Phalcon\Html\Helper\Ul
Phalcon\Html\Link\Link
-
继承
AbstractFactory
-
实现
Tag辅助工具的服务定位器实现。
服务通过构造函数使用键值对进行注册。键是标签辅助工具的名称,而值是一个返回对象的可调用函数。
该类实现了__call()
允许将辅助对象作为方法调用。
@property EscaperInterface $escaper @property array $services
@method string a(string $href, string $text, array $attributes = [], bool $raw = false) @method string base(string $href, array $attributes = []) @method Breadcrumbs breadcrumbs(string $indent = ' ', string $delimiter = "\n") @method string body(array $attributes = []) @method string button(string $text, array $attributes = [], bool $raw = false) @method string close(string $tag, bool $raw = false) @method Doctype doctype(int $flag, string $delimiter) @method string element(string $tag, string $text, array $attributes = [], bool $raw = false) @method string form(array $attributes = []) @method string img(string $src, array $attributes = []) @method Checkbox inputCheckbox(string $name, string $value = null, array $attributes = []) @method Color inputColor(string $name, string $value = null, array $attributes = []) @method Date inputDate(string $name, string $value = null, array $attributes = []) @method DateTime inputDateTime(string $name, string $value = null, array $attributes = []) @method DateTimeLocal inputDateTimeLocal(string $name, string $value = null, array $attributes = []) @method Email inputEmail(string $name, string $value = null, array $attributes = []) @method File inputFile(string $name, string $value = null, array $attributes = []) @method Hidden inputHidden(string $name, string $value = null, array $attributes = []) @method Image inputImage(string $name, string $value = null, array $attributes = []) @method Input inputInput(string $name, string $value = null, array $attributes = []) @method Month inputMonth(string $name, string $value = null, array $attributes = []) @method Numeric inputNumeric(string $name, string $value = null, array $attributes = []) @method Password inputPassword(string $name, string $value = null, array $attributes = []) @method Radio inputRadio(string $name, string $value = null, array $attributes = []) @method Range inputRange(string $name, string $value = null, array $attributes = []) @method Search inputSearch(string $name, string $value = null, array $attributes = []) @method Select inputSelect(string $name, string $value = null, array $attributes = []) @method Submit inputSubmit(string $name, string $value = null, array $attributes = []) @method Tel inputTel(string $name, string $value = null, array $attributes = []) @method Text inputText(string $name, string $value = null, array $attributes = []) @method Textarea inputTextarea(string $name, string $value = null, array $attributes = []) @method Time inputTime(string $name, string $value = null, array $attributes = []) @method Url inputUrl(string $name, string $value = null, array $attributes = []) @method Week inputWeek(string $name, string $value = null, array $attributes = []) @method string label(string $label, array $attributes = [], bool $raw = false) @method Link link(string $indent = ' ', string $delimiter = PHP_EOL) @method Meta meta(string $indent = ' ', string $delimiter = PHP_EOL) @method Ol ol(string $text, array $attributes = [], bool $raw = false) @method Script script(string $indent = ' ', string $delimiter = PHP_EOL) @method Style style(string $indent = ' ', string $delimiter = PHP_EOL) @method Title title(string $indent = ' ', string $delimiter = PHP_EOL) @method Ul ul(string $text, array $attributes = [], bool $raw = false)