承接 tjlytle/render 相关项目开发

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

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

tjlytle/render

Composer 安装命令:

composer require tjlytle/render

包简介

A very simple view rendered for PHP based templates.

README 文档

README

Build Status

Render

A very simple rendered for PHP based templates. Not a template language, just a simple wrapper that handles undefined template variables, helper functions, and turing a phtml file into a string.

If you're using some kind of framework, you probably shouldn't be using this. I threw this together to be pasted (yes, pasted, if you have composer up and running, pull in a real template library) into exsisting legacy projects and turn classic HTML with embedded PHP into a bit more up-to-date PHP rendered templates.

Features

  • Set View Variables
  • Set View Helpers
  • Render Template in Layout

Example

index.php:

$render = new Render('layout.phtml');
$render->name = 'Tim';
$render->message = 'This is a secret message';
$render->encode = function($value){
    return str_rot13($value);
};

echo $render('template.phtml');

layout.phtml:

<html>
  <head>Example Layout</head>
  <body>
    <h1>My Old Site</h1>
    <div><?php echo $this->content; ?></div>
  </body>
</html>

template.phtml

<p>Hi <?php echo $this->name ?>, welcome back.</p>
<p>Here's your secret message: <?php echo $this->encode($this->message); ?></p>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固