Answers.Body: <p>Got It through -></p>
  
  <pre><code>$userInfo[] = array(
    'username' =&gt; $user-&gt;name,
    'details' =&gt;  (string) $user-&gt;details,
  )
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-10T08:50:04.000Z
Answers.LastActivityDate: 2017-04-10T08:50:04.000Z
Answers.UserDisplayName: hashtagerrors
Answers.Body: <p>I'd be inclined to use the public methods for this.
  $user->detail->getRawContent();
  or
  $user->detail->getParsedContent();
  etc.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-14T07:55:55.573Z
Answers.Text: This is more precise response.
Answers.UserDisplayName: Gfra54
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-29T02:53:55.630Z
Answers.LastActivityDate: 2018-05-29T02:53:55.630Z
Answers.UserDisplayName: Walker Designs
Body: <p>I have a 'details' rich text field in my User section. How can i get it in my plugin controller in an array.
  I tried getting it by </p>
  
  <pre><code> $userInfo[] = array(
    'username' =&gt; $user-&gt;name,
    'details' =&gt; $user-&gt;details,
  )
  </code></pre>
  
  <p>I get an array like this</p>
  
  <pre><code>        Array
          (
          [0] =&gt; Array
              (
                  [username] =&gt; Username
                  [details] =&gt; Craft\RichTextData Object
                      (
                          [_pages:Craft\RichTextData:private] =&gt; 
                          [_rawContent:Craft\RichTextData:private] =&gt; Lorem Ipsum is a dummy text
                          [content:protected] =&gt; Lorem Ipsum is a dummy text
                          [charset:protected] =&gt; UTF-8
                      )
                  )
              )
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-11T20:23:15.207Z
Comments.Text: Haha. "How to get rich..." made me smile
Comments.UserDisplayName: Matt P
Tags: <plugins>
Title: How to Get Rich Text field in Plugin?
ThreadText: # How to Get Rich Text field in Plugin?
  
  (Asked by: username_0 on 2017-04-10)
  
  I have a 'details' rich text field in my User section. How can i get it in my plugin controller in an array.
  I tried getting it by
  
  ```
   $userInfo[] = array(
    'username' => $user->name,
    'details' => $user->details,
  )
  
  ```
  
  I get an array like this
  
  ```
          Array
          (
          [0] => Array
              (
                  [username] => Username
                  [details] => Craft\RichTextData Object
                      (
                          [_pages:Craft\RichTextData:private] => 
                          [_rawContent:Craft\RichTextData:private] => Lorem Ipsum is a dummy text
                          [content:protected] => Lorem Ipsum is a dummy text
                          [charset:protected] => UTF-8
                      )
                  )
              )
  
  ```
  
  **Tags:** plugins
  
  > **Comments:**
  > **username_1**: Haha. "How to get rich..." made me smile  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-04-10. Score: 1 | Accepted answer
  
  Got It through ->
  
  ```
  $userInfo[] = array(
    'username' => $user->name,
    'details' =>  (string) $user->details,
  )
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2018-05-29. Score: 3
  
  I'd be inclined to use the public methods for this.
  $user->detail->getRawContent();
  or
  $user->detail->getParsedContent();
  etc.
  
  > **Comments:**
  > **username_3**: This is more precise response.  
  
  ---
  
  