flextype-components/html 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flextype-components/html

Composer 安装命令:

composer require flextype-components/html

包简介

Html Component contains methods that can be useful when working with HTML.

关键字:

README 文档

README

version MIT License

Html Component contains methods that can be useful when working with HTML.

Installation

composer require flextype-components/html

Usage

use Flextype\Component\Html\Html;

Registers a custom macro.

// Registering a Html macro
Html::macro('my_element', function() {
    return '<element id="flextype">';
});

// Calling a custom Html macro
echo Html::my_element();

// Registering a Html macro with parameters
Html::macro('my_element', function($id = '') {
    return '<element id="'.$id.'">';
});

// Calling a custom Html macro with parameters
echo Html::my_element('flextype');

Convert special characters to HTML entities. All untrusted content
should be passed through this method to prevent XSS injections.

echo Html::toText('test');

Compiles an array of HTML attributes into an attribute string.
Attributes will be sorted using Html::$attribute_order for consistency.

echo '<div'.Html::attributes($attrs).'>'.$content.'</div>';

Create br tags

echo Html::br(2);

Create  

echo Html::nbsp(2);

Create an arrow

echo Html::arrow('right');

Create HTML link anchor.

echo Html::anchor('About', 'http://sitename.com/about');

Create HTML tag

echo Html::heading('Title', 1);

Generate document type declarations

echo Html::doctype('html5');

Create image

echo Html::image('data/files/pic1.jpg');

Obfuscate an e-mail address to prevent spam-bots from sniffing it.

echo Html::email('hello@flextype.org');

Obfuscate a string to prevent spam-bots from sniffing it.

This method obfuscate the value, randomly convert each
letter to its entity or hexadecimal representation, keeping a
bot from sniffing the randomly obfuscated letters.

echo Html::obfuscate('hello@flextype.org');

License

See LICENSE

统计信息

  • 总下载量: 3.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固