Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (View\Asset\Repository $assetRepo, View\Asset\GroupedCollection $pageAssets, App\Config\ScopeConfigInterface $scopeConfig, View\Page\FaviconInterface $favicon, Title $title, \Magento\Framework\Locale\ResolverInterface $localeResolver, $isIncludesAvailable=true) | |
setBuilder (View\Layout\BuilderInterface $builder) | |
publicBuild () | |
getTitle () | |
setMetadata ($name, $content) | |
getMetadata () | |
setContentType ($contentType) | |
getContentType () | |
setMediaType ($mediaType) | |
getMediaType () | |
setCharset ($charset) | |
getCharset () | |
setDescription ($description) | |
getDescription () | |
setMetaTitle ($title) | |
getMetaTitle () | |
setKeywords ($keywords) | |
getKeywords () | |
setRobots ($robots) | |
getRobots () | |
getAssetCollection () | |
addPageAsset ($file, array $properties=[], $name=null) | |
addRemotePageAsset ($url, $contentType, array $properties=[], $name=null) | |
addRss ($title, $href) | |
addBodyClass ($className) | |
setElementAttribute ($elementType, $attribute, $value) | |
getElementAttribute ($elementType, $attribute) | |
getElementAttributes ($elementType) | |
setPageLayout ($handle) | |
getPageLayout () | |
getFaviconFile () | |
getDefaultFavicon () | |
getIncludes () | |
Data Fields | |
const | ELEMENT_TYPE_BODY = 'body' |
const | ELEMENT_TYPE_HTML = 'html' |
const | ELEMENT_TYPE_HEAD = 'head' |
const | META_DESCRIPTION = 'description' |
const | META_CONTENT_TYPE = 'content_type' |
const | META_MEDIA_TYPE = 'media_type' |
const | META_CHARSET = 'charset' |
const | META_TITLE = 'title' |
const | META_KEYWORDS = 'keywords' |
const | META_ROBOTS = 'robots' |
const | META_X_UI_COMPATIBLE = 'x_ua_compatible' |
const | BODY_ATTRIBUTE_CLASS = 'class' |
const | HTML_ATTRIBUTE_LANG = 'lang' |
Protected Member Functions | |
build () | |
Protected Attributes | |
$allowedTypes | |
$title | |
$assetRepo | |
$pageAssets | |
$elements = [] | |
$pageLayout | |
$scopeConfig | |
$favicon | |
$localeResolver | |
$builder | |
$includes | |
$metadata | |
An API for page configuration
Has methods for managing properties specific to web pages:
@SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.TooManyFields)
@api
Definition at line 29 of file Config.php.
__construct | ( | View\Asset\Repository | $assetRepo, |
View\Asset\GroupedCollection | $pageAssets, | ||
App\Config\ScopeConfigInterface | $scopeConfig, | ||
View\Page\FaviconInterface | $favicon, | ||
Title | $title, | ||
\Magento\Framework\Locale\ResolverInterface | $localeResolver, | ||
$isIncludesAvailable = true |
|||
) |
\Magento\Framework\View\Asset\Repository | $assetRepo | |
\Magento\Framework\View\Asset\GroupedCollection | $pageAssets | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Framework\View\Page\FaviconInterface | $favicon | |
Title | $title | |
\Magento\Framework\Locale\ResolverInterface | $localeResolver | |
bool | $isIncludesAvailable |
Definition at line 169 of file Config.php.
addBodyClass | ( | $className | ) |
Add CSS class to page body tag
string | $className |
Definition at line 530 of file Config.php.
addPageAsset | ( | $file, | |
array | $properties = [] , |
||
$name = null |
|||
) |
Add asset to page content
string | $file | |
array | $properties | |
string | null | $name |
Definition at line 478 of file Config.php.
addRemotePageAsset | ( | $url, | |
$contentType, | |||
array | $properties = [] , |
||
$name = null |
|||
) |
Add remote page asset
string | $url | |
string | $contentType | |
array | $properties | |
string | null | $name |
Definition at line 496 of file Config.php.
addRss | ( | $title, | |
$href | |||
) |
Add RSS element
string | $title | |
string | $href |
Definition at line 512 of file Config.php.
|
protected |
getAssetCollection | ( | ) |
Returns collection of the assets
Definition at line 464 of file Config.php.
getCharset | ( | ) |
getContentType | ( | ) |
Retrieve Content Type
Definition at line 279 of file Config.php.
getDefaultFavicon | ( | ) |
getDescription | ( | ) |
getElementAttribute | ( | $elementType, | |
$attribute | |||
) |
Retrieve additional element attribute
string | $elementType | |
string | $attribute |
Definition at line 573 of file Config.php.
getElementAttributes | ( | $elementType | ) |
Returns element attributes
string | $elementType |
Definition at line 585 of file Config.php.
getFaviconFile | ( | ) |
getIncludes | ( | ) |
Get miscellaneous scripts/styles to be included in head before head closing tag
Definition at line 638 of file Config.php.
getKeywords | ( | ) |
getMediaType | ( | ) |
getMetadata | ( | ) |
getMetaTitle | ( | ) |
getPageLayout | ( | ) |
getRobots | ( | ) |
getTitle | ( | ) |
publicBuild | ( | ) |
Public build action
TODO Will be eliminated in MAGETWO-28359
Definition at line 223 of file Config.php.
setBuilder | ( | View\Layout\BuilderInterface | $builder | ) |
Set builder.
View\Layout\BuilderInterface | $builder |
Definition at line 198 of file Config.php.
setCharset | ( | $charset | ) |
Set charset
string | $charset |
Definition at line 322 of file Config.php.
setContentType | ( | $contentType | ) |
Set content type
string | $contentType |
Definition at line 269 of file Config.php.
setDescription | ( | $description | ) |
Set description
string | $description |
Definition at line 350 of file Config.php.
setElementAttribute | ( | $elementType, | |
$attribute, | |||
$value | |||
) |
Set additional element attribute
string | $elementType | |
string | $attribute | |
mixed | $value |
Definition at line 554 of file Config.php.
setKeywords | ( | $keywords | ) |
Set keywords
string | $keywords |
Definition at line 405 of file Config.php.
setMediaType | ( | $mediaType | ) |
Set media type
string | $mediaType |
Definition at line 294 of file Config.php.
setMetadata | ( | $name, | |
$content | |||
) |
Set metadata.
string | $name | |
string | $content |
Definition at line 246 of file Config.php.
setMetaTitle | ( | $title | ) |
Set meta title
string | $title |
Definition at line 378 of file Config.php.
setPageLayout | ( | $handle | ) |
setRobots | ( | $robots | ) |
Set robots content
string | $robots |
Definition at line 433 of file Config.php.
|
protected |
Definition at line 63 of file Config.php.
|
protected |
Definition at line 79 of file Config.php.
|
protected |
Definition at line 114 of file Config.php.
|
protected |
Definition at line 89 of file Config.php.
|
protected |
Definition at line 104 of file Config.php.
|
protected |
Definition at line 119 of file Config.php.
|
protected |
Definition at line 109 of file Config.php.
|
protected |
Definition at line 124 of file Config.php.
|
protected |
Definition at line 84 of file Config.php.
|
protected |
Definition at line 94 of file Config.php.
|
protected |
Definition at line 99 of file Config.php.
|
protected |
Definition at line 72 of file Config.php.
const BODY_ATTRIBUTE_CLASS = 'class' |
Constant body attribute class
Definition at line 51 of file Config.php.
const ELEMENT_TYPE_BODY = 'body' |
#+ Constants of available types
Definition at line 34 of file Config.php.
const ELEMENT_TYPE_HEAD = 'head' |
Definition at line 36 of file Config.php.
const ELEMENT_TYPE_HTML = 'html' |
Definition at line 35 of file Config.php.
const HTML_ATTRIBUTE_LANG = 'lang' |
Constant html language attribute
Definition at line 56 of file Config.php.
const META_CHARSET = 'charset' |
Definition at line 42 of file Config.php.
const META_CONTENT_TYPE = 'content_type' |
Definition at line 40 of file Config.php.
const META_DESCRIPTION = 'description' |
#-
Definition at line 39 of file Config.php.
const META_KEYWORDS = 'keywords' |
Definition at line 44 of file Config.php.
const META_MEDIA_TYPE = 'media_type' |
Definition at line 41 of file Config.php.
const META_ROBOTS = 'robots' |
Definition at line 45 of file Config.php.
const META_TITLE = 'title' |
Definition at line 43 of file Config.php.
const META_X_UI_COMPATIBLE = 'x_ua_compatible' |
Definition at line 46 of file Config.php.