| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
Extending Console_CommandLineExtending Console_CommandLine – how to customize this package to achieve specific tasks
Adding custom actionsConsole_CommandLine allows you to register custom actions when you need it. Basically, you just create a action class that inherits from Console_CommandLine_Action and you call the Console_CommandLine::registerAction() method to register it. Let's take a simple example, suppose we want to create a "range" action that would allow the user to type: $ <yourprogram> -r 1,5 And in our Console_CommandLine_Result instance we would have: // $result->options['range']: array('min' => 1, 'max' => 5) Here's how we would do:
<?php
Using a custom rendererTODO: write this section |
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「Extending Console_CommandLine」をGoogle検索
|