<p>This Object has a <code>__toString</code> function that executes <code>return $this-&gt;content;</code>. 
If you are in a template just do</p>

<pre><code>{{ object }}
</code></pre>

<p>You can call the function <code>getParsedContent</code> as well</p>

<pre><code>{{ object.getParsedContent() }}
</code></pre>

<p>In PHP</p>

<pre><code>$text = $object-&gt;getParsedContent();
</code></pre>

CC BY-SA 3.0
2018-04-25T15:25:16.457Z
2018-04-25T15:25:16.457Z
Robin Schambach
<p>I got this kind of object.</p>

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

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

    [charset:protected] =&gt; UTF-8
 )
</code></pre>

<p>Can someone help me to get the text out from this ?</p>

<richtext>
Getting properties out from the Craft text object
# Getting properties out from the Craft text object

(Asked by: username_0 on 2018-04-25)

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 ?

**Tags:** richtext


---

## 1 answers

### Answer by username_1 on 2018-04-25. Score: 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();


---

