PHP Class PicoExcerpt

This plugin exists for backward compatibility and is disabled by default. It gets automatically enabled when {@link PicoDeprecated} is enabled. You can avoid this by calling {@link PicoExcerpt::setEnabled()}. This plugin doesn't do its job very well and depends on {@link PicoParsePagesContent}, what heavily impacts Pico's performance. You should either use the Description meta header field or write something own. Best solution seems to be a filter for twig, see e.g. {@link https://gist.github.com/james2doyle/6629712}.
Author: Daniel Rudolf
Inheritance: extends AbstractPicoPlugin
Afficher le fichier Open project: gilbitron/pico

Protected Properties

Свойство Type Description
$dependsOn This plugin depends on PicoParsePagesContent
$enabled This plugin is disabled by default

Méthodes publiques

Méthode Description
onConfigLoaded ( array &$config ) Adds the default excerpt length of 50 words to the config
onSinglePageLoaded ( array &$pageData ) Creates a excerpt for the contents of each page

Méthodes protégées

Méthode Description
createExcerpt ( string $string, integer $wordLimit ) : string Helper function to create a excerpt of a string

Method Details

createExcerpt() protected méthode

Helper function to create a excerpt of a string
protected createExcerpt ( string $string, integer $wordLimit ) : string
$string string the string to create a excerpt from
$wordLimit integer the maximum number of words the excerpt should be long
Résultat string excerpt of $string

onConfigLoaded() public méthode

Adds the default excerpt length of 50 words to the config
See also: DummyPlugin::onConfigLoaded()
public onConfigLoaded ( array &$config )
$config array

onSinglePageLoaded() public méthode

Creates a excerpt for the contents of each page
See also: PicoExcerpt::createExcerpt()
See also: DummyPlugin::onSinglePageLoaded()
public onSinglePageLoaded ( array &$pageData )
$pageData array

Property Details

$dependsOn protected_oe property

This plugin depends on PicoParsePagesContent
See also: PicoParsePagesContent
See also: AbstractPicoPlugin::$dependsOn
protected $dependsOn

$enabled protected_oe property

This plugin is disabled by default
See also: AbstractPicoPlugin::$enabled
protected $enabled