承接 crazedsanity/template 相关项目开发

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

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

crazedsanity/template

最新稳定版本:v0.4.8

Composer 安装命令:

composer require crazedsanity/template

包简介

Templating library.

README 文档

README

Template system, based on cs_genericPage from cs-content (v1.x).

This is a templating engine, built primarily to allow easy separation between PHP and HTML. Separating PHP from HTML helps keep the code clean and tends to avoid spaghetti code from happening.

Quick Definitions

Template: a file containing template vars.

Template Var: a string of text, following standard variable naming conventions, wrapped in curly braces: {templateVar}

Sample

This is a simple example. Keep in mind that there's a lot of different ways to accomplish this same end result.

$recordSet = array(
			0 => array(
				'primary_id'    => 1,
				'record_name'   => 'The First Record',
				'another_field' => 'field value',
				'is_active'     => 0,
			),
			1 => array(
				'primary_id'    => 3,
				'record_name'   => 'A third record',
				'another_field' => 'something else',
				'is_active'     => 1,
			),
);
$tmpl = new Template(__DIR__ .'/path/to/file.tmpl');
$output = $tmpl->renderRows($recordSet);

The associated template file would look something like this:

===============
{primary_id}|{record_name}|{another_field}|{is_active}|{invalid_field}
----

The output would look like this:

===============
1|The First Record|field value|0|
----
===============
3|A third record|something else|1|
----

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固