Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (Template\Context $context, array $data=[]) | |
setTemplateContext ($templateContext) | |
getTemplate () | |
setTemplate ($template) | |
getTemplateFile ($template=null) | |
getArea () | |
assign ($key, $value=null) | |
fetchView ($fileName) | |
getBaseUrl () | |
getObjectData (\Magento\Framework\DataObject $object, $key) | |
getCacheKeyInfo () | |
![]() | |
__construct (\Magento\Framework\View\Element\Context $context, array $data=[]) | |
getJsLayout () | |
getRequest () | |
getParentBlock () | |
setLayout (\Magento\Framework\View\LayoutInterface $layout) | |
getLayout () | |
setNameInLayout ($name) | |
getChildNames () | |
setAttribute ($name, $value=null) | |
setChild ($alias, $block) | |
addChild ($alias, $block, $data=[]) | |
unsetChild ($alias) | |
unsetCallChild ($alias, $callback, $result, $params) | |
unsetChildren () | |
getChildBlock ($alias) | |
getChildHtml ($alias='', $useCache=true) | |
getChildChildHtml ($alias, $childChildAlias='', $useCache=true) | |
getBlockHtml ($name) | |
insert ($element, $siblingName=0, $after=true, $alias='') | |
append ($element, $alias='') | |
getGroupChildNames ($groupName) | |
getChildData ($alias, $key='') | |
getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null) | |
getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null) | |
getUrl ($route='', $params=[]) | |
getViewFileUrl ($fileId, array $params=[]) | |
formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null) | |
formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false) | |
getModuleName () | |
escapeHtml ($data, $allowedTags=null) | |
escapeJs ($string) | |
escapeHtmlAttr ($string, $escapeSingleQuote=true) | |
escapeCss ($string) | |
stripTags ($data, $allowableTags=null, $allowHtmlEntities=false) | |
escapeUrl ($string) | |
escapeXssInUrl ($data) | |
escapeQuote ($data, $addSlashes=false) | |
escapeJsQuote ($data, $quote='\'') | |
getNameInLayout () | |
getCacheKeyInfo () | |
getCacheKey () | |
getVar ($name, $module=null) | |
isScopePrivate () | |
![]() | |
__construct (array $data=[]) | |
addData (array $arr) | |
setData ($key, $value=null) | |
unsetData ($key=null) | |
getData ($key='', $index=null) | |
getDataByPath ($path) | |
getDataByKey ($key) | |
setDataUsingMethod ($key, $args=[]) | |
getDataUsingMethod ($key, $args=null) | |
hasData ($key='') | |
toArray (array $keys=[]) | |
convertToArray (array $keys=[]) | |
toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
toJson (array $keys=[]) | |
convertToJson (array $keys=[]) | |
toString ($format='') | |
__call ($method, $args) | |
isEmpty () | |
serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
debug ($data=null, &$objects=[]) | |
offsetSet ($offset, $value) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
offsetGet ($offset) | |
![]() | |
toHtml () | |
Data Fields | |
const | XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink' |
![]() | |
const | CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER |
const | CACHE_KEY_PREFIX = 'BLOCK_' |
Protected Member Functions | |
_construct () | |
_toHtml () | |
getRootDirectory () | |
getMediaDirectory () | |
![]() | |
_construct () | |
_prepareLayout () | |
_beforeToHtml () | |
_afterToHtml ($html) | |
_toHtml () | |
_getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound']) | |
getCacheTags () | |
getCacheLifetime () | |
_loadCache () | |
_saveCache ($data) | |
_getSidPlaceholder ($cacheKey=null) | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$_viewVars = [] | |
$_baseUrl | |
$_jsUrl | |
$_allowSymlinks | |
$_filesystem | |
$_template | |
$templateEnginePool | |
$_storeManager | |
$_appState | |
$directory | |
$templateContext | |
$pageConfig | |
$resolver | |
$validator | |
![]() | |
$_design | |
$_session | |
$_sidResolver | |
$_nameInLayout | |
$_layout | |
$jsLayout = [] | |
$_request | |
$_urlBuilder | |
$_eventManager | |
$_frontController | |
$_assetRepo | |
$_viewConfig | |
$_cacheState | |
$_logger | |
$_escaper | |
$filterManager | |
$_localeDate | |
$inlineTranslation | |
$_isScopePrivate = false | |
$_scopeConfig | |
$_cache | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | extractModuleName ($className) |
![]() | |
static | $_underscoreCache = [] |
Standard Magento block. Should be used when you declare a block in frontend area layout handle.
Avoid extending this class.
If you need custom presentation logic in your blocks, use this class as block, and declare custom view models in block arguments in layout handle file.
Example: <block name="my.block" class="Magento\Backend\Block\Template" template="My_Module::template.phtml"> <arguments> <argument name="viewModel" xsi:type="object">My\Module\ViewModel\Custom</argument> </arguments> </block>
@api @SuppressWarnings(PHPMD.NumberOfChildren) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 32 of file Template.php.
__construct | ( | Template\Context | $context, |
array | $data = [] |
||
) |
Constructor
Template\Context | $context | |
array | $data |
Definition at line 144 of file Template.php.
|
protected |
Internal constructor, that is called from real constructor
Definition at line 172 of file Template.php.
|
protected |
Render block HTML
Definition at line 296 of file Template.php.
assign | ( | $key, | |
$value = null |
|||
) |
Assign variable
string | array | $key | |
mixed | $value |
Definition at line 242 of file Template.php.
fetchView | ( | $fileName | ) |
Retrieve block view from file (template)
string | $fileName |
Definition at line 260 of file Template.php.
getArea | ( | ) |
getBaseUrl | ( | ) |
getCacheKeyInfo | ( | ) |
Get cache key informative items
Definition at line 334 of file Template.php.
|
protected |
Get media directory
Definition at line 364 of file Template.php.
getObjectData | ( | \Magento\Framework\DataObject | $object, |
$key | |||
) |
Get data from specified object
\Magento\Framework\DataObject | $object | |
string | $key |
Definition at line 324 of file Template.php.
|
protected |
Instantiates filesystem directory
Definition at line 350 of file Template.php.
getTemplate | ( | ) |
getTemplateFile | ( | $template = null | ) |
Get absolute path to template
string | null | $template |
Definition at line 215 of file Template.php.
setTemplate | ( | $template | ) |
Set path to template used for generating block's output.
string | $template |
Definition at line 203 of file Template.php.
setTemplateContext | ( | $templateContext | ) |
Set template context. Sets the object that should represent $block in template
\Magento\Framework\View\Element\BlockInterface | $templateContext |
Definition at line 163 of file Template.php.
|
protected |
Definition at line 65 of file Template.php.
|
protected |
Definition at line 100 of file Template.php.
|
protected |
Definition at line 51 of file Template.php.
|
protected |
Definition at line 72 of file Template.php.
|
protected |
Definition at line 58 of file Template.php.
|
protected |
Definition at line 93 of file Template.php.
|
protected |
Definition at line 79 of file Template.php.
|
protected |
Definition at line 44 of file Template.php.
|
protected |
Definition at line 107 of file Template.php.
|
protected |
Definition at line 126 of file Template.php.
|
protected |
Definition at line 131 of file Template.php.
|
protected |
Definition at line 121 of file Template.php.
|
protected |
Definition at line 86 of file Template.php.
|
protected |
Definition at line 136 of file Template.php.
const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink' |
Config path to 'Allow Symlinks' template settings
Definition at line 37 of file Template.php.