cnp/wp-atom-builder 问题修复 & 功能扩展

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

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

cnp/wp-atom-builder

Composer 安装命令:

composer require cnp/wp-atom-builder

包简介

Build filterable atomic elements.

README 文档

README

##Atom Builder

The Atom class builds atomic markup from PHP arguments. For example, if you wanted this output:

<h2 class="section-title">A Section Title</h2>

You could use this PHP code to render it:

$section_title_args = [
  'tag' => 'h2',
  'content' => 'A Section Title'
];

$section_title = CNP\Atom::Assemble('section-title', $section_title_args);

echo $section_title;

Sure, this is slightly longer, but here's what is included in the Atom class:

###Filters

All the filters in the Atom class are namespaced to the name of the atom. An atom named 'section-title' would have an arguments filter named 'section-title_args'.

  1. $atom_name_args: filter the arguments array.
  2. $atom_name_classes: filter the classes array.
  3. $atom_name_id: filter the ID.
  4. $atom_name``$attribute_name_value: filter a specific attribute's value.
  5. $atom_name_attributes: filter the completed attributes array.
  6. $atom_name_content: filter the atom content.
  7. $atom_name_markup: filter the compiled markup.

Filtering the markup means that we can dynamically change the atom output on different areas of a site, without needing to change the atom arguments.

This also allows us to create generic blueprints that we can reuse from site-to-site, either adjusting arguments or filtering the atom where necessary.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固