PHP Class Webiny\Component\Bootstrap\ApplicationClasses\View

Show file Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
appendScript ( string $path, string $type = 'text/javascript' ) Append a script to the script array.
appendStyleSheet ( string $path ) Appends a stylesheet to the stylesheet array.
assign ( array $data, string $root = 'Ctrl' ) Assign variables to the view.
getAssignedData ( ) : array Get a list of assigned view data.
getAutoload ( ) : boolean Get the state of view template auto load.
getMeta ( ) : array Get the meta list.
getMetaHtml ( ) : string Get the meta list as html tags.
getScripts ( ) : array Get the script list.
getScriptsHtml ( ) : string Get the script list as html tags.
getStyleSheets ( ) : array Get the stylesheet list.
getStyleSheetsHtml ( ) : string Get the stylesheet list as html tags.
getTemplate ( ) : string Get the assigned view template.
getTitle ( ) : string Get the current page title.
getTitleHtml ( ) : string Get the current page title as html tag.
prependScript ( string $path, string $type = 'text/javascript' ) Prepends a script to the script array.
prependStyleSheet ( string $path ) Prepends a stylesheet to the stylesheet array.
setAutoload ( boolean $autoload ) Set the view template auto load.
setMeta ( string $name, string $content ) Set a html meta tag.
setTemplate ( string $template ) Set the view template file.
setTitle ( string $title ) Set the page title.

Method Details

appendScript() public method

Append a script to the script array.
public appendScript ( string $path, string $type = 'text/javascript' )
$path string Path to the script. It can be relative path to the Public/static folder or a full http path.
$type string Script type, default is 'text/javascript'.

appendStyleSheet() public method

Appends a stylesheet to the stylesheet array.
public appendStyleSheet ( string $path )
$path string Path to the stylesheet. It can be relative path to the Public/static folder or a full http path.

assign() public method

Assign variables to the view.
public assign ( array $data, string $root = 'Ctrl' )
$data array List of variables that should be assigned.
$root string Variable root. Default root is Ctrl.

getAssignedData() public method

Get a list of assigned view data.
public getAssignedData ( ) : array
return array

getAutoload() public method

Get the state of view template auto load.
public getAutoload ( ) : boolean
return boolean

getMeta() public method

Get the meta list.
public getMeta ( ) : array
return array

getMetaHtml() public method

Get the meta list as html tags.
public getMetaHtml ( ) : string
return string

getScripts() public method

Get the script list.
public getScripts ( ) : array
return array

getScriptsHtml() public method

Get the script list as html tags.
public getScriptsHtml ( ) : string
return string

getStyleSheets() public method

Get the stylesheet list.
public getStyleSheets ( ) : array
return array

getStyleSheetsHtml() public method

Get the stylesheet list as html tags.
public getStyleSheetsHtml ( ) : string
return string

getTemplate() public method

Get the assigned view template.
public getTemplate ( ) : string
return string Path to the view template.

getTitle() public method

Get the current page title.
public getTitle ( ) : string
return string

getTitleHtml() public method

Get the current page title as html tag.
public getTitleHtml ( ) : string
return string

prependScript() public method

Prepends a script to the script array.
public prependScript ( string $path, string $type = 'text/javascript' )
$path string Path to the script. It can be relative path to the Public/static folder or a full http path.
$type string Script type, default is 'text/javascript'.

prependStyleSheet() public method

Prepends a stylesheet to the stylesheet array.
public prependStyleSheet ( string $path )
$path string Path to the stylesheet. It can be relative path to the Public/static folder or a full http path.

setAutoload() public method

Set the view template auto load.
public setAutoload ( boolean $autoload )
$autoload boolean Should the view template file be auto loaded or not.

setMeta() public method

Set a html meta tag.
public setMeta ( string $name, string $content )
$name string Meta name.
$content string Meta value.

setTemplate() public method

Set the view template file.
public setTemplate ( string $template )
$template string Path to template file.

setTitle() public method

Set the page title.
public setTitle ( string $title )
$title string Page title.