roesch / html-format
一个简单易用的PHP编写的HTML美化类。作为composer库添加,以纪念Bennett Roesch(spyrosoft)。
v0.1.1
2018-01-29 17:15 UTC
Requires
- php: ~5.6|~7.0
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2024-09-14 06:05:00 UTC
README
一个简单易用的PHP编写的HTML美化类。作为composer库添加,以纪念Bennett Roesch(spyrosoft)。
原始代码来自:https://github.com/spyrosoft/php-format-html-output
安装
使用以下命令通过composer安装此包
$ composer require roesch/html-format
示例用法
<?php
require 'vendor/autoload.php';
$html = 'Unformatted HTML string';
// initialize class
$format = new \Roesch\Format();
// use spaces at 4 length
echo $format->html($html);
// use spaces at 2 length
echo $format->html($html, true, 2);
// use tabs
echo $format->html($html, false);
静态方法示例用法
<?php
require 'vendor/autoload.php';
$html = 'Unformatted HTML string';
// use spaces at 4 length
echo \Roesch\Format::HTML($html);
// use spaces at 2 length
echo \Roesch\Format::HTML($html, true, 2);
// use tabs
echo \Roesch\Format::HTML($html, false);
测试
$ composer test
贡献
有关详细信息,请参阅CONTRIBUTING
致谢
许可协议
MIT许可协议(MIT)。有关更多信息,请参阅许可文件