theroadbunch/command-menu 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

theroadbunch/command-menu

Composer 安装命令:

composer require theroadbunch/command-menu

包简介

A simple class for command menus

README 文档

README

A simple menu for symfony console commands

Latest Stable Version License: MIT Compatible Symfony Version

a quick note:
This README assumes you have an understanding of creating and running a console command in the symfony ecosystem

Contents

  1. Release Notes
  2. Installation
  3. Usage
    a. Basic Usage
    b. Selectors
    c. Wrappers
  4. License

Install using composer [?]

composer require theroadbunch/command-menu

Basic Usage

Creating, rendering, and using a menu in your symfony console command

<?php

// ...
use RoadBunch\CommandMenu\Menu;
use RoadBunch\CommandMenu\Option;

// ...

public function execute(InputInterface $input, OutputInterface $output)
{      
    // create the menu
    $menu = new Menu($input, $output);
    
    // optional title
    $menu->title('Options');
    
    // add options
    $menu->addOption('add', 'Add User');
    $menu->addOption('delete', 'Delete User');
    $menu->addOption('quit', 'Quit');
    
    // render the menu
    $menu->render();
        
    // prompt the user to make a selection
    $selection = $menu->promptForSelection();
    
    // do work
}

Output

Options
-------

1 Add User
2 Delete User
3 Quit

Please make a selection:
> |

If the user selects 1 then promptForSelection() will return "add", 2 will return "delete", and 3 will return "quit"
In the event a user selects something other than a given selector, promptForSelection() will return null

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固