macfja/symfony-console-filechooser
最新稳定版本:1.0.0
Composer 安装命令:
composer require macfja/symfony-console-filechooser
包简介
Filechooser Helper for Symfony console (with autocompletion support)
关键字:
README 文档
README
The library provide a file selector capacity to any symfony console application. It's support autocomplete functionality for navigating in directory.
Installation
Composer
composer require macfja/symfony-console-filechooser
Usage
use MacFJA\Symfony\Console\Filechooser\FilechooserHelper; use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; $app = new Application(); // Adding the helper to Symfony Console Application $app->getHelperSet()->set(new FilechooserHelper()); $app->register('ask-path')->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { // ask and validate the answer $dialog = $app->getHelperSet()->get('filechooser'); $filter = new \MacFJA\Symfony\Console\Filechooser\FileFilter('Where is your file? '); $path = $dialog->ask($input, $output, $filter); $output->writeln(sprintf('You have just entered: %s', $path)); }); $app->run();
统计信息
- 总下载量: 13.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-29