定制 zamasskin/html-constructor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

zamasskin/html-constructor

Composer 安装命令:

composer require zamasskin/html-constructor

包简介

Html engine components

README 文档

README

Instead of writing HTML or using an HTML templating engine, you compose your layout using PHP structures with the dash-html-components library.

Installation

Install composer.

Run the following in the root of your project:

composer require zamasskin/html-constructor dev-main

Or, create a composer.json file with the following contents and run "composer install":

{
  "require": {
    "zamasskin/html-constructor": "dev-main"
  }
}

Usage

<?php
use HtmlConstructor\Tags;
require_once "vendor/autoload.php";
$html = (new Tags\TextContent\Div())
            ->style("color: red; background: #000")
            ->className("parent")
            ->children([
                (new Tags\TextContent\Div())->className("one"),
                (new Tags\TextContent\Div())->className("two"),
            ]);
echo $html->render();
// <div style="color: red; background: #000" class="parent"><div class="one"></div><div class="two"></div></div>


$html = Tags::Div()->className("root")->children([
    Tags::Span('main caption')->className("caption"),
    Tags::A('http://example.com', 'main link')->className("link")
]);
echo $html->render();
// <div class="root"><span class="caption">main caption</span><a href="http://example.com" class="link">main link</a></div>



$html = (new Tags\Tag("custom"))->setAttribute("data", "test");
echo $html->render();
// <custom data="%test"></custom>

$html = Tags::Tag("custom")->setAttribute("data", "test");
echo $html->render();
// <custom data="%test"></custom>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固