Class luya\web\jsonld\TextValue

Inheritanceluya\web\jsonld\TextValue » luya\web\jsonld\BaseValue
Available since version1.0.3
Source Code https://github.com/luyadev/luya/blob/master/core/web/jsonld/TextValue.php

Text Value.

The text value provides option to auto shorten content.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Provide date data. luya\web\jsonld\TextValue
encode() Html encode the text data. luya\web\jsonld\TextValue
getValue() Get the value to assign from BaseValue. luya\web\jsonld\TextValue
truncate() Truncate the string for a given lenth. luya\web\jsonld\TextValue

Method Details

Hide inherited methods

__construct() public method

Provide date data.

public void __construct ( $text )
$text

                public function __construct($text)
{
    $this->_text = $text;
}

            
encode() public method

Html encode the text data.

public luya\web\jsonld\TextValue encode ( )

                public function encode()
{
    $this->_text = Html::encode($this->_text);
    
    return $this;
}

            
getValue() public method

Get the value to assign from BaseValue.

public void getValue ( )

                public function getValue()
{
    return $this->_text;
}

            
truncate() public method

Truncate the string for a given lenth.

public luya\web\jsonld\TextValue truncate ( $length )
$length integer

                public function truncate($length)
{
    $this->_text = StringHelper::truncate($this->_text, $length);
    
    return $this;
}