rpalladino / php-lipsum
使用www.lipsum.com生成虚拟文本的CLI和PHP类
v1.0
2015-05-11 03:22 UTC
Requires
- symfony/console: ~2.6
Requires (Dev)
- apigen/apigen: ^4.1
- phpunit/phpunit: ~4.5
This package is not auto-updated.
Last update: 2024-09-29 02:49:46 UTC
README
使用www.lipsum.com生成Lorem ipsum文本的CLI和PHP类
安装
通过Composer
$ composer require rpalladino/php-lipsum
用法
CLI
$ ./vendor/bin/lipsum
选项
Usage: lipsum [-w|--what="..."] [-a|--amount="..."] [-s|--start-with-lipsum] Options: --what (-w) The kind of text to generate: paras, words, bytes, lists (default: "paras") --amount (-a) The amount of text to generate (default: 5) --start-with-lipsum (-s) Start generated text with "Lorem ipsum dolor sit amet."
示例
# get 1 paragraph of text $ ./vendor/bin/lipsum -a 1 # get 25 words of text beginning with "lorem ipsum" $ ./vendor/bin/lipsum -w words -a 25 -s # get 3 list items $ ./vendor/bin/lipsum -w lists -a 3
PHP类
require "vendor/autoload.php"; $lipsum = new Rpalladino\Lipsum\Lipsum(); // get 1 paragraph of text $lipsum->getParagraphs(1); // get 25 words of text beginning with "lorem ipsum" $lipsum->getWords(25, true); // get 3 list items $lipsum->getLists(3);
许可证
MIT许可证(MIT)。请参阅许可证文件获取更多信息。