PHP Класс luya\console\Command

The main different to the \luya\console\Controller is by adding default options to each command like the verbose and interactive properties you can always access and use. In addition there are some helper methods commonly used to build wizzwards within command controllers.
Автор: Basil Suter ([email protected])
Наследование: extends Controller
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$interactive Whether the command is in interactive mode or not, provided by option paremeters.
$verbose Whether the verbose printing is enabled from options parameter or not.

Открытые методы

Метод Описание
createClassName ( string $string, string $suffix = false ) : string Generates a class name with camelcase style and specific suffix, if not already provided
getGeneratorText ( string $command ) : string Generates the LUYA text which all generator files should include.
getLuyaVersion ( ) : string Get the current Luya Version
options ( $actionID )
selectModule ( array $options = [] ) : string Get selection list for console commands with defined options.
selectModuleType ( ) : string Get selection list of all module types.
verbosePrint ( string $message, string $section = null ) Method to print informations directly when verbose is enabled.

Описание методов

createClassName() публичный Метод

Generates a class name with camelcase style and specific suffix, if not already provided
С версии: 1.0.0-beta4
public createClassName ( string $string, string $suffix = false ) : string
$string string The name of the class, e.g.: hello_word would
$suffix string The suffix to append on the class name if not eixsts, e.g.: MySuffix
Результат string The class name e.g. HelloWorldMySuffix

getGeneratorText() публичный Метод

Generates the LUYA text which all generator files should include.
public getGeneratorText ( string $command ) : string
$command string The command which is used like `crud/create` or `aw/create`.
Результат string The text to insert.

getLuyaVersion() публичный Метод

Get the current Luya Version
С версии: 1.0.0-beta4
public getLuyaVersion ( ) : string
Результат string

options() публичный Метод

public options ( $actionID )

selectModule() публичный Метод

Get selection list for console commands with defined options.
С версии: 1.0.0-beta4
public selectModule ( array $options = [] ) : string
$options array Define behavior of the module selector prompt, options are name-value pairs. The following options are available: - onlyAdmin: boolean, if enabled all not admin modules will not be included - hideCore: boolean, if enabled all core modules (from luya dev team) will be hidden.
Результат string The name (ID) of the selected module.

selectModuleType() публичный Метод

Get selection list of all module types.
С версии: 1.0.0-beta4
public selectModuleType ( ) : string
Результат string

verbosePrint() публичный Метод

Method to print informations directly when verbose is enabled.
public verbosePrint ( string $message, string $section = null )
$message string
$section string

Описание свойств

$interactive публичное свойство

Whether the command is in interactive mode or not, provided by option paremeters.
public $interactive

$verbose публичное свойство

Whether the verbose printing is enabled from options parameter or not.
public $verbose