Class luya\web\jsonld\TextValue
| Inheritance | luya\web\jsonld\TextValue ยป luya\web\jsonld\BaseValue |
|---|---|
| Available since version | 1.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
| 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
Provide date data.
| public void __construct ( $text ) | ||
| $text | ||
public function __construct($text)
{
$this->_text = $text;
}
Html encode the text data.
| public luya\web\jsonld\TextValue encode ( ) |
public function encode()
{
$this->_text = Html::encode($this->_text);
return $this;
}
Get the value to assign from BaseValue.
| public void getValue ( ) |
public function getValue()
{
return $this->_text;
}
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;
}