ui-awesome/html-contracts
Composer 安装命令:
composer require ui-awesome/html-contracts
包简介
Shared interfaces for the UI Awesome HTML ecosystem: rendering, attribute management, element typing, and form controls.
关键字:
README 文档
README
Html helper
Contracts (interfaces) for the UI Awesome HTML ecosystem for PHP
Provides shared interfaces for rendering, attribute management, and form control typing across HTML packages.
Installation
composer require ui-awesome/html-contracts:^0.1
Interfaces
RenderableInterface
Core contract for any object that can be rendered as an HTML string. Extends Stringable.
<?php declare(strict_types=1); use UIAwesome\Html\Contracts\RenderableInterface; final class MyTag implements RenderableInterface { public function __toString(): string { return $this->render(); } public function render(): string { return '<div>Hello</div>'; } }
AttributesInterface
Contract for objects that manage HTML attributes with an immutable API.
Methods: attributes(), class(), getAttribute(), getAttributes(), removeAttribute(), setAttribute().
FormControlInterface
Composed interface extending both RenderableInterface and AttributesInterface. Use this to type form control
elements (inputs, selects, textareas, etc.) that need both rendering and attribute management.
<?php declare(strict_types=1); use UIAwesome\Html\Contracts\Form\FormControlInterface; function renderField(FormControlInterface $control): string { return $control->class('form-control')->render(); }
Documentation
For detailed configuration options and advanced usage.
Package information
Quality code
Our social networks
License
统计信息
- 总下载量: 5.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-02-26