定制 mykehowells/powerhtml 二次开发

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

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

mykehowells/powerhtml

Composer 安装命令:

composer require mykehowells/powerhtml

包简介

HTML templating and parsing engine

README 文档

README

Stable version Unstable version

Create HTML template with .pwr.html extension and make use in emails or whatever else!

Installation

composer require mykehowells/powerhtml

Usage

Include the composer autoloader

require __DIR__ . '/../vendor/autoload.php'

Getting started with a basic PowerHTML setup. The below code would output the processed PowerHTML template to the browser.

$powerHtml = new \PowerHTML\PowerHTML;

$template = ( $_SERVER[ 'REQUEST_URI'] == '/' ) ? null : ltrim( $_SERVER[ 'REQUEST_URI'], '/' );

$powerHtml->with( 'hello', 'hello world' )
    ->parse( $template );

$powerHtml->render();

If you're looking to store the parsed html into a variable, use store() rather than render().

Options

Change Template Directory

Default: /resources/templates

$options = [
    'template_dir' => __DIR__ . '/public/templates'
];

$powerHtml = new \PowerHTML\PowerHTML( $options );

Stop PHP Evaluation

Stopping PHP evaluation will stop the curly braces from being parsed in your templates. For example: {{$my_var}} would be output as {{$my_var}}.

$options = [
    'allow_php_eval' => false
];

$powerHtml = new \PowerHTML\PowerHTML( $options );

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL
  • 更新时间: 2020-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固