PHP 클래스 Craft\SeomaticTwigExtension

상속: extends Twig_Extension
파일 보기 프로젝트 열기: nystudio107/seomatic

보호된 프로퍼티들

프로퍼티 타입 설명
$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