Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Debug
  • FilterInput
  • Highlighter
  • Language
  • Loader
  • Metagen
  • Request
  • Utilities
  • Yaml
  • Overview
  • Namespace
  • Class
  • Tree

Class Metagen

Metagen facilitates generating and assigning page meta tags

Namespace: Xmf
Package: Xmf
Category: Xmf\Module\Metagen
Copyright: 2011-2014 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Author: trabis lusopoemas@gmail.com
Version: Release: 1.0
Since: 1.0
Link: http://xoops.org
Located at oops_lib/Xmf/Metagen.php
Methods summary
public static
# assignTitle( string $title )

assignTitle set the page title

assignTitle set the page title

Parameters

$title
page title
public static
# assignKeywords( array $keywords )

assignKeywords set the meta keywords tag

assignKeywords set the meta keywords tag

Parameters

$keywords
keywords for page
public static
# assignDescription( string $description )

assignDescription set the meta description tag

assignDescription set the meta description tag

Parameters

$description
page description
public static array
# generateKeywords( string $body, integer $count = 20, integer $minLength = 4, string[]|null $forceKeys = null )

generateKeywords builds a set of keywords from text body

generateKeywords builds a set of keywords from text body

Parameters

$body
text to extract keywords from
$count
number of keywords to use
$minLength
minimum length of word to consider as a keyword
$forceKeys
array of keywords to force use, or null for none

Returns

array
of keywords
protected static boolean
# checkStopWords( string $key )

checkStopWords - look up a word in a list of stop words and classify it as a significant word or a stop word.

checkStopWords - look up a word in a list of stop words and classify it as a significant word or a stop word.

Parameters

$key
the word to check

Returns

boolean
True if word is significant, false if it is a stop word
public static string
# generateDescription( string $body, integer $wordCount = 100 )

generateDescription - generate a short description from a body of text

generateDescription - generate a short description from a body of text

Parameters

$body
body text
$wordCount
maximum word count for description

Returns

string
public static
# generateMetaTags( string $title, string $body, integer $count = 20, integer $minLength = 4, integer $wordCount = 100, string[]|null $forceKeys = null )

generateMetaTags - generate and assign all meta tags

generateMetaTags - generate and assign all meta tags

Parameters

$title
title
$body
body text
$count
maximum keywords to use
$minLength
minimum length of word to consider as keyword
$wordCount
maximum word count for description summary
$forceKeys
associative array of keywords to force use
protected static boolean
# nonEmptyString( string $var )

Return true if the string is length > 0

Return true if the string is length > 0

Parameters

$var
to test

Returns

boolean

Author

psylove
public static string
# generateSeoTitle( string $title = '', string $extension = '' )

Create a title for the short_url field of an article

Create a title for the short_url field of an article

Parameters

$title
title of the article
$extension
extension to add

Returns

string
sort_url for the article

Author

psylove
public static string
# getSearchSummary( string $haystack, mixed $needles = null, integer $length = 120 )

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.

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.

Parameters

$haystack
the string to summarize
$needles
search term, array of search terms, or null
$length
maximum length for the summary

Returns

string
a substring of haystack
protected static string
# asPlainText( string $rawText )

asPlainText - clean string to be plain text, without control characters such as newlines, html markup, or leading trailing or repeating spaces.

asPlainText - clean string to be plain text, without control characters such as newlines, html markup, or leading trailing or repeating spaces.

Parameters

$rawText
a text string to be cleaned

Returns

string
Constants summary
string ELLIPSIS

Unicode horizontal ellipsis U+2026 This will be used to replace omitted text.

Unicode horizontal ellipsis U+2026 This will be used to replace omitted text.

# "…"
API documentation generated by ApiGen