everton3x/html-object-model 问题修复 & 功能扩展

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

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

everton3x/html-object-model

Composer 安装命令:

composer require everton3x/html-object-model

包简介

Library for creating object-oriented HTML entities, in the Document Object Model style.

README 文档

README

It provides web developers with an abstraction for html entities similar to the Document Object Model.

Anyone who uses PHP for web development is used to using object orientation daily. However, when the developer goes on to create the user interface, he invariably has to leave object orientation to write markup code. Even if the web developer uses some template tools, like Twig, even so, he needs to have a lot of work with HTML making the models, besides needing to use a whole library of templates, usually bigger and with more features than necessary.

It is for this context that the Html Object Model was conceived: to make it possible to develop user interfaces in fully object-oriented HTML. Html Object Model is inspired by the PHP Object Model Document and allows the web developer to create HTML in an object-oriented way.

Installation

The standard method of installation is through Composer:

composer require everton3x/html-object-model

Use

The Html Object Model workflow follows the following scheme:

Create -> Configure -> Build

See an example:

<?php

require_once 'vendor/autoload.php';// Don't forget to include the Composer Autoloader.

// Create
$entity = new HtmlObjectModel\Element('input');

// Configure
$entity->setAttribute('id', 'entity1')
    ->setAttribute('class', 'mystyle')
    ->setAttribute('name', 'myfield');

// Build
echo $entity->build();

The generated html code should look something like:

<input id="entity1" class="mystyle" name="myfield">

Html Object Model offers many other methods for manipulating attributes and children (nodes) in HTML entities created with this library. Be sure to read the documentation to learn about all the available features and about API.

How to contribute

Please, see the CONTRIBUTING section on project wiki.

Mantainer

Everton da Rosa

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固