承接 hexmakina/marker 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

hexmakina/marker

Composer 安装命令:

composer require hexmakina/marker

包简介

Marker is an HTML generator

README 文档

README

Scrutinizer Code Quality Maintainability PSR-4 Compliant PSR-12 Compliant PHP 7.4 Required Latest Stable Version License

Marker

HTML Generation classes Hommage to Christian François Bouche-Villeneuve aka Chris Marker

Class Element

The Element class provides a simple and useful implementation for creating, and generating valid HTML elements using PHP The __toString() method of the Element class generates the HTML code for the element based on its tag, attributes, and content

Additionally, the Element class provides a static shorthand syntax, using __callStatic() matching the name of the HTML Element to create

The first argument is the content, the second are the attributes

$abbr = Element::abbr('RTFM', ['title' => 'read the file manual']); $p = Element:p('You reading this means you know about '.$abbr); echo $p; //

You reading this means you know about RTFM

::span('inner text', ['class' => 'd-block']) ::p('lorem ipsum') ::img(null, ['src' => 'path/to/jpeg.png', alt='hyper descriptive', 'width' => 100, 'height'=>100]) ::a('click here', ['href' => 'url/to/destination', 'class' => 'nav-link']) ::a('anchor title', ['name' => 'anchor_name'])

Regarding the attributes array, the keys represent the attribute names, and the values represent the attribute values. If an attribute key is an integer, the corresponding attribute name and value are treated as a boolean attribute.

Example usage:

$element = new Element('section', 'Hello World!', [
    'id' => 'publication',
    'class' => 'container',
    'data-toggle' => 'modal',
    'data-target' => '#myModal',
]);

<section id="publication" class="container" data-toggle="modal" "data-target"="#myModal">Hello World!</section>

Or, with void element and boolean attributes:

$element = new Element('input', null, [ 'type' => 'checkbox', 'checked', 'disabled', 'class' => 'checkbutton' ]);

Class WCAGElement

This class extends the Element class and provides methods to enforce WCAG (Web Content Accessibility Guidelines) compliance for certain HTML elements.

Class Marker

Class Form

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2021-08-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固