承接 pxlbros/lightncandy-cli 相关项目开发

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

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

pxlbros/lightncandy-cli

最新稳定版本:1.0.6

Composer 安装命令:

composer require pxlbros/lightncandy-cli

包简介

A PHP CLI wrapper for the mustache/handlebars PHP implementation lightncandy to aid build processes.

README 文档

README

LightnCandy-CLI is a CLI wrapper around the PHP implementation of mustache/handlebars LightnCandy. This CLI tool can be used in your build process to compile mustache/handlebars templates to PHP to be used with the LightnCandy library or on their own.

Installation

LightnCandy-CLI is meant to be used as a CLI tool and can be globally installed with composer like so: composer global require pxlbros/lightncandy-cli Make sure you have ~/.composer/vendor/bin/ in your path.

You can also install LightnCandy-CLI into your project directory and run it straight from the vendor folder if you want to.

Usage

Basic

The first and only unamed argument is a path to the template file that you wish to compile.

$ lightncandy path/to/template.hbs

If omitted, LightnCandy-CLI will use STDIN as the template. This is usefull because you can pipe input into the utility.

$ echo 'Hello {{name}}!' | lightncandy

By default LightnCandy-CLI will pipe the compiled template to STDOUT but you can also write the output to disk by providing a path.

$ lightncandy path/to/template.hbs -o path/to/output.php

LightnCandy Options

LightnCandy supports many flags that can be used to configure how it compiles your templates. A list of these options and what they do can be found on the page for the LightnCandy library. You can toggle them like so:

$ lightncandy path/to/template.hbs --FLAG_BARE --FLAG_HANDLEBARSJS

You can also use $ lightncandy --help to see a list of availible options and their descriptions in your command line.

Other Options

basedir

-b/--basedir "path/to/partials/directory/ path/to/different/dir" Space seperted list of directory paths containing partial templates.

helpers

-p/--helpers "path/to/helpers/directory/ path/to/different/dir" Space seperated list of directory paths containing helper functions.

blockhelpers

-k/--blockhelpers "path/to/blockhelpers/directory/ path/to/different/dir" Space seperated list of directory paths containing block helper functions.

hbhelpers

-h/--hbhelpers "path/to/hbhelpers/directory/ path/to/different/dir" Space seperated list of directory paths containing handlebars style helper functions.

fileext

-e/--fileext ".tmpl .partial" Space seperated list of file extensions for template files.

render

-r/--render If provided, will run the compiled template and will output the result instead.

data

-d/--data JSON string to pass to the rendering function if the render flag is provided.

compress

-c/--compress Compress the output to reduce file size by around 30%.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 12
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-01