PHP Trait Contao\TemplateInheritance

Show file Open project: contao/core-bundle

Protected Properties

Property Type Description
$arrBlockNames array Block names
$arrBlocks array Blocks
$strDefault string Default template
$strFormat string Output format
$strParent string Parent template
$strTagEnding string Tag ending
$strTemplate string Template file

Public Methods

Method Description
block ( string $name ) Start a new block
endblock ( ) End a block
extend ( string $name ) Extend another template
inherit ( ) : string Parse the template file and return it as string
insert ( string $name, array $data = null ) Insert a template
parent ( ) Insert the content of the parent block

Protected Methods

Method Description
getTemplatePath ( string $strTemplate, string $strFormat = 'html5', boolean $blnDefault = false ) : string Find a particular template file and return its path

Method Details

block() public method

Start a new block
public block ( string $name )
$name string The block name

endblock() public method

End a block
public endblock ( )

extend() public method

Extend another template
public extend ( string $name )
$name string The template name

getTemplatePath() protected method

Find a particular template file and return its path
protected getTemplatePath ( string $strTemplate, string $strFormat = 'html5', boolean $blnDefault = false ) : string
$strTemplate string The name of the template
$strFormat string The file extension
$blnDefault boolean If true, the default template path is returned
return string The path to the template file

inherit() public method

Parse the template file and return it as string
public inherit ( ) : string
return string The template markup

insert() public method

Insert a template
public insert ( string $name, array $data = null )
$name string The template name
$data array An optional data array

parent() public method

Insert the content of the parent block
public parent ( )

Property Details

$arrBlockNames protected property

Block names
protected array $arrBlockNames
return array

$arrBlocks protected property

Blocks
protected array $arrBlocks
return array

$strDefault protected property

Default template
protected string $strDefault
return string

$strFormat protected property

Output format
protected string $strFormat
return string

$strParent protected property

Parent template
protected string $strParent
return string

$strTagEnding protected property

Tag ending
protected string $strTagEnding
return string

$strTemplate protected property

Template file
protected string $strTemplate
return string