定制 sageit/markupengine 二次开发

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

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

sageit/markupengine

Composer 安装命令:

composer require sageit/markupengine

包简介

Allows you to create HTML custom tags that aids in templating and providing easy to use extendable functionality that designers find easy to work with.

README 文档

README

Logo

MarkupEngine

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Allows you to create HTML markup tags that are rendered via class extensions to the included CustomMarkup Class. Markup intended for simple visual elements reaused throughout code and should not inlcude Database calls (separate of View and Modal)

Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Installation

Git:

git clone https://github.com/SageITSolutions/MarkupEngine.git

Composer:

composer require sageit/markupengine

Usage

This project consists of an included MarkupEngine class which parses custom HTML tags into valid HTML.

Components:

  • MarkupEngine.php class (parser)
  • CustomMarkup.php class (abstract base class used by parser)
  • tags/mytagname.php (customizable folder containing tag classes which must extend CustomMarkup)

Example Tag.

<header title="attribute">
    This is an example block of code.
    This body would return as the Tag's "Content" while some would be an accessible attribute in the header class.
</header>
<youtube src="QR-tZqiKCrg"/>

Integrated Example

<?php

require_once '../lib/MarkupEngine.php';

$ME = new MarkupEngine([]
    'parse_on_shutdown' 	=> true,
    'tag_directory' 		=> __DIR__.DIRECTORY_SEPARATOR.'tags'.DIRECTORY_SEPARATOR,
    'sniff_for_buried_tags' => true
]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Example Page</title>
    <meta name="author" content="Daniel S. Davis">
    <!-- Date: 2020-10-06 -->
</head>
<body> 
    <youtube src="QR-tZqiKCrg"/>
</body>
</html>

Inside the related tag file; tags/youtube.php:

<?php
namespace MarkupEngine;

class Youtube extends CustomMarkup{

	public function render(){
		return <<< HTML
			<iframe width="560" height="315" 
				src="https://www.youtube.com/embed/{$this->src}" 
				frameborder="0" 
				allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
				allowfullscreen>
			</iframe>

HTML;
		}
	}
?>

Resulting output:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd"> 

<html lang="en"> 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Example Page</title>
    <meta name="author" content="Daniel S. Davis">
    <!-- Date: 2020-10-06 -->
</head>
<body> 
    <iframe width="560" height="315" 
	src="https://www.youtube.com/embed/QR-tZqiKCrg" 
	frameborder="0" 
	allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
	allowfullscreen>
</iframe>
</body> 
</html>

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Sage IT Solutions - Email

Project Link: https://github.com/SageITSolutions/MarkupEngine

Acknowledgements

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固