PHP Class luya\console\commands\BlockController

Author: Basil Suter ([email protected])
Inheritance: extends luya\console\Command
Show file Open project: luyadev/luya Class Usage Examples

Public Properties

Property Type Description
$cacheEnabled Whether the caching property should be displayed or not inside the block.
$config Provide the configuration array which is inside the config() method of the block.
$dryRun If dry run is enabled the content of the block will be returned but no files will be created. This is usefull for unit testing.
$extras An array with the list of extras which are generated during the var creator process, example content 'foo' => 'value',
$isContainer Whether the block is a container/layout block or not this will enable/dsiable the $isContainer property
$moduleName If type is module the name of the module must be provided with this $moduleName property.
$phpdoc An array with all phpdoc comments which should be added to the admin template, exmaple content ['{{extras.foobar}}'].
$type The type of block, valid app (static::TYPE_APP) or module (static::TYPE_TMODULE) values.
$viewFileDoc Am array with additional docblocks messages to render inside the view file.

Public Methods

Method Description
actionCreate ( ) : number Wizzard to create a new CMS block.
generateViewFile ( string $blockClassName ) : string Generate the view file for the block.
getBlockName ( ) : string Getter method fro $blockName.
setBlockName ( string $name ) Setter method for $blockName, ensure the correct block name.

Protected Methods

Method Description
getFileBasePath ( ) : string Get the full base path to the folder of the module
getFileNamespace ( ) : string Get the file namespace based on its type.

Private Methods

Method Description
getExtraVarDef ( $type, $varName, $func )
getModuleProposal ( ) : array Get an array with all modules where you can generate blocks for.
getVariableTypeOption ( $type )
getVariableTypes ( )
getVariableTypesOptions ( )
hasVariableTypeOption ( $type )
placeholderCreator ( $prefix )
varCreator ( string $prefix, string $typeCast ) : array Create a variable based of user input.

Method Details

actionCreate() public method

Wizzard to create a new CMS block.
public actionCreate ( ) : number
return number

generateViewFile() public method

Generate the view file for the block.
public generateViewFile ( string $blockClassName ) : string
$blockClassName string The name of the block class.
return string The rendered view file.

getBlockName() public method

Getter method fro $blockName.
public getBlockName ( ) : string
return string Get the ensured block name.

getFileBasePath() protected method

Get the full base path to the folder of the module
protected getFileBasePath ( ) : string
return string The full path to the module folder.

getFileNamespace() protected method

Get the file namespace based on its type.
protected getFileNamespace ( ) : string
return string The full qualified namespace based on the type

setBlockName() public method

Setter method for $blockName, ensure the correct block name.
public setBlockName ( string $name )
$name string The name of the block.

Property Details

$cacheEnabled public property

Whether the caching property should be displayed or not inside the block.
public $cacheEnabled

$config public property

Provide the configuration array which is inside the config() method of the block.
public $config

$dryRun public property

If dry run is enabled the content of the block will be returned but no files will be created. This is usefull for unit testing.
public $dryRun

$extras public property

An array with the list of extras which are generated during the var creator process, example content 'foo' => 'value',
public $extras

$isContainer public property

Whether the block is a container/layout block or not this will enable/dsiable the $isContainer property
public $isContainer

$moduleName public property

If type is module the name of the module must be provided with this $moduleName property.
public $moduleName

$phpdoc public property

An array with all phpdoc comments which should be added to the admin template, exmaple content ['{{extras.foobar}}'].
public $phpdoc

$type public property

The type of block, valid app (static::TYPE_APP) or module (static::TYPE_TMODULE) values.
public $type

$viewFileDoc public property

Am array with additional docblocks messages to render inside the view file.
public $viewFileDoc