CakePHP
  • 文档
    • 书籍
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 标识和商标
  • 商业解决方案
  • 商品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与进来
    • 问题 (Github)
    • Bakery
    • 精选资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C CakePHP 5.1 Chiffon API

  • 项目
    • CakePHP
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 5.1
      • 5.1
      • 5.0
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

命名空间

  • 全局
  • Cake
    • 缓存
    • 集合
    • 命令
    • 控制台
    • 控制器
    • 核心
    • 数据库
    • 数据源
    • 错误
    • 事件
    • 表单
    • Http
    • 国际化
    • 日志
    • 邮件
    • 网络
    • ORM
    • 路由
    • 测试套件
    • 实用工具
    • 验证
    • 视图
      • 异常
      • 表单
      • 助手
      • 小部件

类 BasicWidget

基本输入类。

此输入类可用于呈现基本的简单输入元素,例如隐藏、文本、电子邮件、电话和其他类型。

命名空间: Cake\View\Widget

属性摘要

  • $_templates protected
    Cake\View\StringTemplate

    StringTemplate 实例。

  • $defaults protected
    array<string, mixed>

    数据默认值。

方法摘要

  • __construct() public

    构造函数。

  • mergeDefaults() protected

    将默认值与提供的數據合并。

  • render() public

    渲染文本小部件或其他简单小部件,如电子邮件/电话/数字。

  • secureFields() public

    返回需要为此小部件安全化的字段列表。

  • setMaxLength() protected

    设置适用的“maxlength”属性的值。

  • setRequired() protected

    设置适用的“required”属性的值。

  • setStep() protected

    设置适用的“step”属性的值。

方法详细

__construct() ¶ public

__construct(Cake\View\StringTemplate $templates)

构造函数。

参数
Cake\View\StringTemplate $templates

模板列表。

mergeDefaults() ¶ protected

mergeDefaults(array<string, mixed> $data, Cake\View\Form\ContextInterface $context): array<string, mixed>

将默认值与提供的數據合并。

参数
array<string, mixed> $data

数据数组

Cake\View\Form\ContextInterface $context

上下文实例。

返回
array<string, mixed>

render() ¶ public

render(array<string, mixed> $data, Cake\View\Form\ContextInterface $context): string

渲染文本小部件或其他简单小部件,如电子邮件/电话/数字。

此方法接受许多键

  • name name 属性。
  • val value 属性。
  • escape 设置为 false 以禁用所有属性的转义。

提供的 $data 中的任何其他键将被转换为 HTML 属性。

参数
array<string, mixed> $data

用于构建输入的数据。

Cake\View\Form\ContextInterface $context

当前表单上下文。

返回
string

secureFields() ¶ public

secureFields(array<string, mixed> $data): list<string>

返回需要为此小部件安全化的字段列表。

参数
array<string, mixed> $data
返回
list<string>

setMaxLength() ¶ protected

setMaxLength(array<string, mixed> $data, Cake\View\Form\ContextInterface $context, string $fieldName): array<string, mixed>

设置适用的“maxlength”属性的值。

参数
array<string, mixed> $data

数据数组

Cake\View\Form\ContextInterface $context

上下文实例。

string $fieldName

字段名称。

返回
array<string, mixed>

setRequired() ¶ protected

setRequired(array<string, mixed> $data, Cake\View\Form\ContextInterface $context, string $fieldName): array<string, mixed>

设置适用的“required”属性的值。

参数
array<string, mixed> $data

数据数组

Cake\View\Form\ContextInterface $context

上下文实例。

string $fieldName

字段名称。

返回
array<string, mixed>

setStep() ¶ protected

setStep(array<string, mixed> $data, Cake\View\Form\ContextInterface $context, string $fieldName): array<string, mixed>

设置适用的“step”属性的值。

参数
array<string, mixed> $data

数据数组

Cake\View\Form\ContextInterface $context

上下文实例。

string $fieldName

字段名称。

返回
array<string, mixed>

属性详细

$_templates ¶ protected

StringTemplate 实例。

类型
Cake\View\StringTemplate

$defaults ¶ protected

数据默认值。

类型
array<string, mixed>
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 书籍
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 标识和商标
  • 社区
  • 参与进来
  • 问题 (Github)
  • Bakery
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成