PHP Класс Craft\SeomaticTwigExtension

Наследование: extends Twig_Extension
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$seomaticInitializing

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

Метод Описание
encodeEmailAddress ( $emailAddress ) * -------------------------------------------------------------------------------- Encode an email address as ordinal values to obfuscate it to bots --------------------------------------------------------------------------------
extractKeywords ( $text = null, $limit = 15, $withoutStopWords = true ) * -------------------------------------------------------------------------------- Extract the most important words from the passed in text via TextRank --------------------------------------------------------------------------------
extractSummary ( $text = null, $limit = null, $withoutStopWords = true ) * -------------------------------------------------------------------------------- Extract a summary from the text, or if it's not long enough, just return the text --------------------------------------------------------------------------------
extractTextFromMatrix ( $matrixBlocks ) * -------------------------------------------------------------------------------- Extract all of the text and rich text from the fields in MatrixBlockModels --------------------------------------------------------------------------------
getFilters ( ) * -------------------------------------------------------------------------------- Return our twig filters --------------------------------------------------------------------------------
getFullyQualifiedUrl ( $url ) * -------------------------------------------------------------------------------- Get a fully qualified URL based on the siteUrl, if no scheme/host is present --------------------------------------------------------------------------------
getFunctions ( ) * -------------------------------------------------------------------------------- Return our twig functions --------------------------------------------------------------------------------
getGlobals ( ) * -------------------------------------------------------------------------------- Return our global variables --------------------------------------------------------------------------------
getLocalizedUrls ( ) * -------------------------------------------------------------------------------- Returns an array of localized URLs for the current request --------------------------------------------------------------------------------
getName ( ) * -------------------------------------------------------------------------------- The name of our Twig extension --------------------------------------------------------------------------------
renderJSONLD ( $object = [] ) * -------------------------------------------------------------------------------- Render a generic JSON-LD object, passed in as an array() in the format:
truncateStringOnWord ( $theString, $desiredLength ) * -------------------------------------------------------------------------------- Truncate the the string passed in, breaking it on a word. $desiredLength is in characters; the returned string will be broken on a whole-word boundary, with an … appended to the end if it is truncated --------------------------------------------------------------------------------

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

Метод Описание
_get_current_template_path ( ) * -------------------------------------------------------------------------------- Get the current template path --------------------------------------------------------------------------------

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

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

* -------------------------------------------------------------------------------- Encode an email address as ordinal values to obfuscate it to bots --------------------------------------------------------------------------------
public encodeEmailAddress ( $emailAddress )

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

* -------------------------------------------------------------------------------- Extract the most important words from the passed in text via TextRank --------------------------------------------------------------------------------
public extractKeywords ( $text = null, $limit = 15, $withoutStopWords = true )

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

* -------------------------------------------------------------------------------- Extract a summary from the text, or if it's not long enough, just return the text --------------------------------------------------------------------------------
public extractSummary ( $text = null, $limit = null, $withoutStopWords = true )

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

* -------------------------------------------------------------------------------- Extract all of the text and rich text from the fields in MatrixBlockModels --------------------------------------------------------------------------------
public extractTextFromMatrix ( $matrixBlocks )

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

* -------------------------------------------------------------------------------- Return our twig filters --------------------------------------------------------------------------------
public getFilters ( )

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

* -------------------------------------------------------------------------------- Get a fully qualified URL based on the siteUrl, if no scheme/host is present --------------------------------------------------------------------------------
public getFullyQualifiedUrl ( $url )

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

* -------------------------------------------------------------------------------- Return our twig functions --------------------------------------------------------------------------------
public getFunctions ( )

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

* -------------------------------------------------------------------------------- Return our global variables --------------------------------------------------------------------------------
public getGlobals ( )

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

* -------------------------------------------------------------------------------- Returns an array of localized URLs for the current request --------------------------------------------------------------------------------
public getLocalizedUrls ( )

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

* -------------------------------------------------------------------------------- The name of our Twig extension --------------------------------------------------------------------------------
public getName ( )

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

PHP: $myJSONLD = array( "type" => "Corporation", "name" => "nystudio107", "sameAs" => ["https://Twitter.com/nystudio107","https://plus.google.com/+nystudio107"], "address" => array( "type" => 'PostalAddress', "addressCountry" => "USA", ), ); Twig: {% set myJSONLD = { "type": "Corporation", "name": "nystudio107", "sameAs": ["https://Twitter.com/nystudio107","https://plus.google.com/+nystudio107"], "address": { "type": 'PostalAddress', "addressCountry": "USA", }, } %} The array can be nested arbitrarily deep with sub-arrays. The first key in the array, and in each sub-array, should be an "type" with a valid Schema.org type as the value. Because Twig doesn't support array keys with non-alphanumeric characters, SEOmatic transforms the keys "type" into "@type" at render time. --------------------------------------------------------------------------------
public renderJSONLD ( $object = [] )

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

* -------------------------------------------------------------------------------- Truncate the the string passed in, breaking it on a word. $desiredLength is in characters; the returned string will be broken on a whole-word boundary, with an … appended to the end if it is truncated --------------------------------------------------------------------------------
public truncateStringOnWord ( $theString, $desiredLength )

Описание свойств

$seomaticInitializing защищенное свойство

protected $seomaticInitializing