PHP Class 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.
Author: Basil Suter ([email protected])
Inheritance: extends Controller
Datei anzeigen Open project: luyadev/luya Class Usage Examples

Public Properties

Property Type Description
$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.

Public Methods

Method Description
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.

Method Details

createClassName() public method

Generates a class name with camelcase style and specific suffix, if not already provided
Since: 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
return string The class name e.g. HelloWorldMySuffix

getGeneratorText() public method

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`.
return string The text to insert.

getLuyaVersion() public method

Get the current Luya Version
Since: 1.0.0-beta4
public getLuyaVersion ( ) : string
return string

options() public method

public options ( $actionID )

selectModule() public method

Get selection list for console commands with defined options.
Since: 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.
return string The name (ID) of the selected module.

selectModuleType() public method

Get selection list of all module types.
Since: 1.0.0-beta4
public selectModuleType ( ) : string
return string

verbosePrint() public method

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

Property Details

$interactive public_oe property

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

$verbose public_oe property

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