Download the PHP package heartsentwined/zf2-cli without Composer
On this page you can find all versions of the php package heartsentwined/zf2-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heartsentwined/zf2-cli
More information about heartsentwined/zf2-cli
Files in heartsentwined/zf2-cli
Package zf2-cli
Short Description helper functions for building a zf2 CLI app
License ISC
Homepage https://github.com/yalesov/zf2-cli
Informations about the package zf2-cli
zf2-cli
helper functions for building a zf2 CLI app
Installation
Copy config/cli.local.php.dist
into (app root)/config/autoload/cli.local.php
, and edit configs as described below in Setup templates.
Usage
Get an instance of cli
Use service locator.
Or just instantiate one manually.
Templated-text
Often you need to display similarly-formatted text in a CLI app, e.g. section titles.
Setup templates
Add a template named section
, which outputs a blue string ## %s ##
(%s
replaced by actual text).
template
: (optional),%s
as text placeholder; not set ='%s'
(plain text)color
: (optional), a\Zend\Console\ColorInterface
defined constant name; not set = default / normal color
You can also inject templates through the config file:
This will setup the templates section
, task
, and module
.
Output text
This will output the string foo
using the section
template. In the above example setup, this will output ## foo ##
, with yellow color.
You can also capture the output string instead of printing it directly:
All versions of zf2-cli with dependencies
yalesov/arg-validator Version 2.*
zendframework/zend-console Version 2.*