Property | Type | Description | |
---|---|---|---|
$isDisabled | |||
$isRendered |
Property | Type | Description | |
---|---|---|---|
$actionView | |||
$appRootDir | |||
$config | |||
$controllersViewPath | |||
$definedRaws | |||
$ext | View file extension | ||
$isActionViewAbsolute | |||
$isLayoutAbsolute | |||
$layout | |||
$parsed | |||
$renderedContent | |||
$templateDir | |||
$templates |
Method | Description | |
---|---|---|
__construct ( |
The constructor | |
__string ( ) | ||
actionViewExists ( ) : boolean | Retun bool if the action view file exists | |
addTemplate ( type $name, type $src, $absolutePath = false ) : Voodoo\Core\View | To add a template file | |
addTemplateString ( string $name, string $content ) : Voodoo\Core\View | To add a template string | |
clearFlashMessage ( ) : |
Clear flash message | |
exists ( ) : boolean | Check if the views directory exists | |
getEngine ( ) : Handlebars\Handlebars\Handlebars | Return the view engine | |
getFilePath ( strin $path = "index" ) : string | Return the complete file path of the template in the current view. | |
getFlashMessage ( string $type = null ) : Array | Get flash message | |
getFormat ( ) : string | Return the view format | |
issetActionView ( ) : boolean | Return if the view is set | |
issetLayout ( ) : boolean | Return if the layout is set | |
removeTemplate ( type $name ) : Voodoo\Core\View | To remove a template name | |
render ( ) : String | Render the template | |
reparse ( ) : Voodoo\Core\View | To reset the parsing | |
setActionError ( string $errorMessage = "", integer $errorCode = 500 ) : Voodoo\Core\View | To set the error page | |
setActionView ( string $filename, boolean $absolute = false ) : Voodoo\Core\View | Set the view body to use. By default it will use the the action view => $action.html | |
setDescription ( string $description ) : |
Set the description | |
setFlashMessage ( type $message, type $type = View\FlashMessage::TYPE_NOTICE, array $data = [] ) : |
Set a flash message | |
setFormat ( type $format ) : |
Set the view format | |
setKeywords ( array $keywords ) : |
Set the keywords | |
setMeta ( type $key, type $value ) : |
Set multiple meta data | |
setPagination ( array $data ) : |
Set the pagination model | |
setTitle ( string $title, boolean $concat = false, integer $position = self::TITLE_CONCAT_APPEND ) : |
To set the title | |
useLayout ( string $filename, $isAbsolute = false ) : Voodoo\Core\View | Set the view layout to use. By default it will user the contain set in config. |
Method | Description | |
---|---|---|
loadFile ( type $src ) : string | Load the template file |
Method | Description | |
---|---|---|
addExt ( string $file ) : string | Add file extension if ommitted | |
assign_ ( mixed $key, mixed $value = null ) : |
Assign data to _.* For local use only | |
getModuleAssetsDir ( ) : string | To create the module's assets dir Base on the config file | |
getPublicAssetsDir ( ) : string | To create the shared assets dir Base on the config file | |
parse ( ) | Parse the template | |
parseTemplate ( string $template ) : string | Parse the template and catch any {{!include }} expression |
public __construct ( |
||
$controller |
public actionViewExists ( ) : boolean | ||
return | boolean |
public addTemplate ( type $name, type $src, $absolutePath = false ) : Voodoo\Core\View | ||
$name | type | - the name of the template. Can be used to call it: {{!include @name}} |
$src | type | - the filepath relative to the working dir |
return | Voodoo\Core\View |
public addTemplateString ( string $name, string $content ) : Voodoo\Core\View | ||
$name | string | |
$content | string | |
return | Voodoo\Core\View |
public clearFlashMessage ( ) : |
||
return |
public getEngine ( ) : Handlebars\Handlebars\Handlebars | ||
return | Handlebars\Handlebars\Handlebars |
public getFilePath ( strin $path = "index" ) : string | ||
$path | strin | |
return | string |
public getFlashMessage ( string $type = null ) : Array | ||
$type | string | - Return flash messages of a type |
return | Array | [message, type, data] |
public issetActionView ( ) : boolean | ||
return | boolean |
public issetLayout ( ) : boolean | ||
return | boolean |
public removeTemplate ( type $name ) : Voodoo\Core\View | ||
$name | type | |
return | Voodoo\Core\View |
public reparse ( ) : Voodoo\Core\View | ||
return | Voodoo\Core\View |
public setActionError ( string $errorMessage = "", integer $errorCode = 500 ) : Voodoo\Core\View | ||
$errorMessage | string | |
$errorCode | integer | |
return | Voodoo\Core\View |
public setActionView ( string $filename, boolean $absolute = false ) : Voodoo\Core\View | ||
$filename | string | |
$absolute | boolean | - true, it will use the full path of filename, or it will look in the current Views |
return | Voodoo\Core\View |
public setDescription ( string $description ) : |
||
$description | string | |
return |
public setFlashMessage ( type $message, type $type = View\FlashMessage::TYPE_NOTICE, array $data = [] ) : |
||
$message | type | |
$type | type | |
$data | array | |
return |
public setFormat ( type $format ) : |
||
$format | type | |
return |
public setKeywords ( array $keywords ) : |
||
$keywords | array | |
return |
public setMeta ( type $key, type $value ) : |
||
$key | type | |
$value | type | |
return |
public setPagination ( array $data ) : |
||
$data | array | |
return |