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
파일 보기 프로젝트 열기: luyadev/luya 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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