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
Afficher le fichier Open project: luyadev/luya Class Usage Examples

Méthodes publiques

Свойство 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.

Méthodes publiques

Méthode 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 méthode

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
Résultat string The class name e.g. HelloWorldMySuffix

getGeneratorText() public méthode

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`.
Résultat string The text to insert.

getLuyaVersion() public méthode

Get the current Luya Version
Since: 1.0.0-beta4
public getLuyaVersion ( ) : string
Résultat string

options() public méthode

public options ( $actionID )

selectModule() public méthode

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.
Résultat string The name (ID) of the selected module.

selectModuleType() public méthode

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

verbosePrint() public méthode

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