PHP Class Timber\PostPreview

Since: 1.0.4
Mostrar archivo Open project: jarednova/timber

Protected Properties

Property Type Description
$char_length
$end
$force
$length
$post
$readmore
$strip

Public Methods

Method Description
__construct ( Post $post )
__toString ( )
chars ( integer $char_length = false )
end ( string $end = '…' )
force ( boolean $force = true )
length ( integer $length = 50 )
read_more ( string $readmore = 'Read More' )
strip ( boolean | string $strip = true )

Protected Methods

Method Description
assemble ( string $text, array | booelan $readmore_matches, boolean $trimmed )
run ( )

Method Details

__construct() public method

public __construct ( Post $post )
$post Post

__toString() public method

public __toString ( )

assemble() protected method

protected assemble ( string $text, array | booelan $readmore_matches, boolean $trimmed )
$text string
$readmore_matches array | booelan
$trimmed boolean was the text trimmed?

chars() public method

public chars ( integer $char_length = false )
$char_length integer (in characters) of the target preview

end() public method

public end ( string $end = '…' )
$end string how should the text in the preview end

force() public method

public force ( boolean $force = true )
$force boolean If the editor wrote a manual excerpt longer than the set length, should it be "forced" to the size specified?

length() public method

public length ( integer $length = 50 )
$length integer (in words) of the target preview

read_more() public method

public read_more ( string $readmore = 'Read More' )
$readmore string What the text displays as to the reader inside of the tag

run() protected method

protected run ( )

strip() public method

public strip ( boolean | string $strip = true )
$strip boolean | string strip the tags or what? You can also provide a list of allowed tags

Property Details

$char_length protected_oe property

protected $char_length

$end protected_oe property

protected $end

$force protected_oe property

protected $force

$length protected_oe property

protected $length

$post protected_oe property

protected $post

$readmore protected_oe property

protected $readmore

$strip protected_oe property

protected $strip