1

I got this kind of object.

Craft\RichTextData Object
(
    [_pages:Craft\RichTextData:private] => 
    [_rawContent:Craft\RichTextData:private] => 
    Standard Rate:  Cancellation policy is 24 hours prior to 11.00am 
        on day of arrival.

    [content:protected] => 
    Standard Rate:  Cancellation policy is 24 hours prior to 11.00am 
        on day of arrival.

    [charset:protected] => UTF-8
 )

Can someone help me to get the text out from this ?

1 Answer 1

2

This Object has a __toString function that executes return $this->content;. If you are in a template just do

{{ object }}

You can call the function getParsedContent as well

{{ object.getParsedContent() }}

In PHP

$text = $object->getParsedContent();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.