|
static | assignTitle ($title) |
|
static | assignKeywords ($keywords) |
|
static | assignDescription ($description) |
|
static | generateKeywords ( $body, $count=20, $minLength=4, $forceKeys=null) |
|
static | generateDescription ($body, $wordCount=100) |
|
static | generateMetaTags ( $title, $body, $count=20, $minLength=4, $wordCount=100, $forceKeys=null) |
|
static | generateSeoTitle ($title='', $extension='') |
|
static | getSearchSummary ($haystack, $needles=null, $length=120) |
|
static | checkStopWords ($key) |
|
◆ asPlainText()
static asPlainText |
( |
|
$rawText | ) |
|
|
staticprotected |
asPlainText - clean string to be plain text, without control characters such as newlines, html markup, or leading trailing or repeating spaces.
- Paramètres
-
string | $rawText | a text string to be cleaned |
- Renvoie
- string
◆ assignDescription()
static assignDescription |
( |
|
$description | ) |
|
|
static |
assignDescription set the meta description tag
- Paramètres
-
string | $description | page description |
- Renvoie
- void
◆ assignKeywords()
static assignKeywords |
( |
|
$keywords | ) |
|
|
static |
assignKeywords set the meta keywords tag
- Paramètres
-
string[] | $keywords | keywords list |
- Renvoie
- void
◆ assignTemplateVar()
static assignTemplateVar |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
staticprotected |
assign meta variables in template engine
- Paramètres
-
string | $name | variable name (i.e. xoops_pagtitle) |
string | $value | meta value |
◆ assignThemeMeta()
static assignThemeMeta |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
staticprotected |
assign meta variables in template engine
- Paramètres
-
string | $name | meta name (keywords, description) |
string | $value | meta value |
◆ assignTitle()
static assignTitle |
( |
|
$title | ) |
|
|
static |
assignTitle set the page title
- Paramètres
-
- Renvoie
- void
◆ checkStopWords()
static checkStopWords |
( |
|
$key | ) |
|
|
static |
checkStopWords - look up a word in a list of stop words and classify it as a significant word or a stop word.
- Paramètres
-
string | $key | the word to check |
- Renvoie
- bool True if word is significant, false if it is a stop word
- Obsolète:
- since v1.2.0 - use Xmf\StopWords::check()
◆ generateDescription()
static generateDescription |
( |
|
$body, |
|
|
|
$wordCount = 100 |
|
) |
| |
|
static |
generateDescription - generate a short description from a body of text
- Paramètres
-
string | $body | body text |
integer | $wordCount | maximum word count for description |
- Renvoie
- string
◆ generateKeywords()
static generateKeywords |
( |
|
$body, |
|
|
|
$count = 20 , |
|
|
|
$minLength = 4 , |
|
|
|
$forceKeys = null |
|
) |
| |
|
static |
generateKeywords builds a set of keywords from text body
- Paramètres
-
string | $body | text to extract keywords from |
integer | $count | number of keywords to use |
integer | $minLength | minimum length of word to consider as a keyword |
string[] | null | $forceKeys | array of keywords to force use, or null for none |
- Renvoie
- array of keywords
◆ generateMetaTags()
static generateMetaTags |
( |
|
$title, |
|
|
|
$body, |
|
|
|
$count = 20 , |
|
|
|
$minLength = 4 , |
|
|
|
$wordCount = 100 , |
|
|
|
$forceKeys = null |
|
) |
| |
|
static |
generateMetaTags - generate and assign all meta tags
- Paramètres
-
string | $title | title |
string | $body | body text |
int | $count | maximum keywords to use |
int | $minLength | minimum length of word to consider as keyword |
int | $wordCount | maximum word count for description summary |
string[] | null | $forceKeys | associative array of keywords to force use |
- Renvoie
- void
◆ generateSeoTitle()
static generateSeoTitle |
( |
|
$title = '' , |
|
|
|
$extension = '' |
|
) |
| |
|
static |
Create a title for the short_url field of an article
- Paramètres
-
string | $title | title of the article |
string | $extension | extension to add |
- Renvoie
- string sort_url for the article
- Auteur
- psylove
◆ getNeedlePositions()
static getNeedlePositions |
( |
|
$haystack, |
|
|
|
$needles |
|
) |
| |
|
staticprotected |
getNeedlePositions - Essentially this is a strpos() for an array of needles. Given a haystack and an array of needles, return an array of all initial positions, if any, of those needles in that haystack.
- Paramètres
-
string | $haystack | the string to summarize |
mixed | $needles | search term, array of search terms, or null |
- Renvoie
- integer[] array of initial positions of substring of haystack
◆ getSearchSummary()
static getSearchSummary |
( |
|
$haystack, |
|
|
|
$needles = null , |
|
|
|
$length = 120 |
|
) |
| |
|
static |
getSearchSummary splits a string into string no larger than a specified length, and centered around the first occurrence of any of an array of needles, or starting at the beginning of the string if no needles are specified or found.
The string will be broken on spaces and an ellipsis (…) will be added to the string when broken.
- Paramètres
-
string | $haystack | the string to summarize |
mixed | $needles | search term, array of search terms, or null |
int | $length | maximum character length for the summary |
- Renvoie
- string a substring of haystack
◆ html2text()
static html2text |
( |
|
$document | ) |
|
|
staticprotected |
html2text This will remove HTML tags, javascript sections and white space. It will also convert some common HTML entities to their text equivalent. Credits to newbb2
- Paramètres
-
string | $document | HTML to be converted |
- Renvoie
- string Text version of $document parameter
◆ nonEmptyString()
static nonEmptyString |
( |
|
$var | ) |
|
|
staticprotected |
Return true if the string is length > 0
- Paramètres
-
- Renvoie
- boolean
- Auteur
- psylove
◆ purifyText()
static purifyText |
( |
|
$text, |
|
|
|
$keyword = false |
|
) |
| |
|
staticprotected |
purifyText
- Paramètres
-
string | $text | text to clean |
boolean | $keyword | replace some punctuation with white space |
- Renvoie
- string cleaned text
◆ stopWordsObject()
static stopWordsObject |
( |
| ) |
|
|
staticprotected |
◆ ELLIPSIS
horizontal ellipsis This will be used to replace omitted text.
◆ ENCODING
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/libraries/vendor/xoops/xmf/src/Metagen.php