PHP Класс Frontend\Core\Engine\Header

..)
Наследование: extends Frontend\Core\Engine\Base\Object
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
addCSS ( string $file, boolean $minify = true, boolean $addTimestamp = null ) Add a CSS file into the array
addJS ( string $file, boolean $minify = true, boolean $addTimestamp = null, integer $priorityGroup = self::PRIORITY_GROUP_DEFAULT ) Add a javascript file into the array
addJsData ( string $module, string $key, mixed $value ) Add data into the jsData
addLink ( array $attributes, boolean $overwrite = false, mixed $uniqueKeys = null ) Add link
addMetaData ( array $attributes, boolean $overwrite = false, mixed $uniqueKeys = null, mixed $additionalKey = null ) Add meta data
addMetaDescription ( string $value, boolean $overwrite = false ) Add meta-description, somewhat a shortcut for the addMetaData-method
addMetaKeywords ( string $value, boolean $overwrite = false ) Add meta-keywords, somewhat a shortcut for the addMetaData-method
addOpenGraphData ( string $key, string $value, boolean $overwrite = false ) Add Open Graph data
addOpenGraphImage ( string $image, boolean $overwrite = false, integer $width, integer $height ) Add Open Graph image
addRssLink ( string $title, string $link ) Add Rss link
extractOpenGraphImages ( string $content ) Extract images from content that can be added add Open Graph image
getCSSFiles ( ) : array Get all added CSS files
getJSFiles ( ) : array get all added javascript files
getLinks ( ) : array Get all links
getMeta ( ) : array Get meta
getMetaCustom ( ) : string Get the custom meta
getMetaValue ( string $attribute, string $attributeValue ) : array Get all attributes for meta tag specified by the attribute and the value for that attribute.
getPageTitle ( ) : string Get the page title
parse ( ) Parse the header into the template
setCanonicalUrl ( string $url ) Set the canonical URL
setMetaCustom ( string $meta ) Set the custom meta
setPageTitle ( string $value, boolean $overwrite = false ) Set the page title
setTwitterCard ( string $title, string $description, string $imageURL, string $cardType = 'summary', string $siteHandle = null, string $creatorHandle = null ) Set Twitter Card

Приватные методы

Метод Описание
cssSort ( array $cssFiles ) : array Sort function for CSS-files
minifyCSS ( string $file ) : string Minify a CSS-file
minifyJS ( string $file ) : string Minify a javascript-file
parseCSS ( ) Parse the CSS-files
parseCustomHeaderHTMLAndGoogleAnalytics ( ) Parse Google Analytics
parseFacebook ( ) Parse Facebook related header-data
parseJS ( ) Parse the JS-files
parseMetaAndLinks ( ) Parse the meta and link-tags
parseSeo ( ) Parse SEO specific data

Описание методов

__construct() публичный Метод

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface

addCSS() публичный Метод

Add a CSS file into the array
public addCSS ( string $file, boolean $minify = true, boolean $addTimestamp = null )
$file string The path for the CSS-file that should be loaded.
$minify boolean Should the CSS be minified?
$addTimestamp boolean May we add a timestamp for caching purposes?

addJS() публичный Метод

Add a javascript file into the array
public addJS ( string $file, boolean $minify = true, boolean $addTimestamp = null, integer $priorityGroup = self::PRIORITY_GROUP_DEFAULT )
$file string The path to the javascript-file that should be loaded.
$minify boolean Should the file be minified?
$addTimestamp boolean May we add a timestamp for caching purposes?
$priorityGroup integer

addJsData() публичный Метод

Add data into the jsData
public addJsData ( string $module, string $key, mixed $value )
$module string The name of the module.
$key string The key whereunder the value will be stored.
$value mixed The value

addMetaData() публичный Метод

Add meta data
public addMetaData ( array $attributes, boolean $overwrite = false, mixed $uniqueKeys = null, mixed $additionalKey = null )
$attributes array The attributes to parse.
$overwrite boolean Should we overwrite the current value?
$uniqueKeys mixed Which keys can we use to decide if an item is unique.
$additionalKey mixed This additional key helps you to create your own custom unique keys if required.

addMetaDescription() публичный Метод

Add meta-description, somewhat a shortcut for the addMetaData-method
public addMetaDescription ( string $value, boolean $overwrite = false )
$value string The description.
$overwrite boolean Should we overwrite the previous value?

addMetaKeywords() публичный Метод

Add meta-keywords, somewhat a shortcut for the addMetaData-method
public addMetaKeywords ( string $value, boolean $overwrite = false )
$value string The description.
$overwrite boolean Should we overwrite the previous value?

addOpenGraphData() публичный Метод

Add Open Graph data
public addOpenGraphData ( string $key, string $value, boolean $overwrite = false )
$key string The key (without og:).
$value string The value.
$overwrite boolean Should we overwrite the previous value?

addOpenGraphImage() публичный Метод

Add Open Graph image
public addOpenGraphImage ( string $image, boolean $overwrite = false, integer $width, integer $height )
$image string The path to the image.
$overwrite boolean Should we overwrite the previous value?
$width integer The width of the image.
$height integer The height of the image.

extractOpenGraphImages() публичный Метод

Extract images from content that can be added add Open Graph image
public extractOpenGraphImages ( string $content )
$content string The content (where from to extract the images).

getCSSFiles() публичный Метод

Get all added CSS files
public getCSSFiles ( ) : array
Результат array

getJSFiles() публичный Метод

get all added javascript files
public getJSFiles ( ) : array
Результат array

getMeta() публичный Метод

Get meta
public getMeta ( ) : array
Результат array

getMetaCustom() публичный Метод

Get the custom meta
public getMetaCustom ( ) : string
Результат string

getMetaValue() публичный Метод

Get all attributes for meta tag specified by the attribute and the value for that attribute.
public getMetaValue ( string $attribute, string $attributeValue ) : array
$attribute string The attribute to match on.
$attributeValue string The value for the unique attribute.
Результат array

getPageTitle() публичный Метод

Get the page title
public getPageTitle ( ) : string
Результат string

parse() публичный Метод

Parse the header into the template
public parse ( )

setCanonicalUrl() публичный Метод

Set the canonical URL
public setCanonicalUrl ( string $url )
$url string The Canonical URL.

setMetaCustom() публичный Метод

Set the custom meta
public setMetaCustom ( string $meta )
$meta string The meta data to set.

setPageTitle() публичный Метод

Set the page title
public setPageTitle ( string $value, boolean $overwrite = false )
$value string The page title to be set or to be prepended.
$overwrite boolean Should the existing page title be overwritten?

setTwitterCard() публичный Метод

Set Twitter Card
public setTwitterCard ( string $title, string $description, string $imageURL, string $cardType = 'summary', string $siteHandle = null, string $creatorHandle = null )
$title string The title (maximum 70 characters)
$description string A brief description of the card (maximum 200 characters)
$imageURL string The URL of the image (minimum 280x150 and <1MB)
$cardType string The cardtype, possible types: https://dev.twitter.com/cards/types
$siteHandle string (optional) Twitter handle of the site
$creatorHandle string (optional) Twitter handle of the author