Answers.Body: <p>Yes, you can do similar to CRM_Core_Error::debug_var but using the html dumper:</p>
  <pre><code>$dumpForm = (new \Symfony\Component\VarDumper\Dumper\HtmlDumper('php://output'))
    -&gt;dump((new \Symfony\Component\VarDumper\Cloner\VarCloner())-&gt;cloneVar($form));
  CRM_Core_Error::debug($dumpForm);
  </code></pre>
  <p>and then there's little expandy triangles on the right of expandable lines:</p>
  <p><a href="https://i.sstatic.net/SNET0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SNET0.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T16:31:13.743Z
Answers.LastActivityDate: 2023-05-28T16:31:13.743Z
Answers.UserDisplayName: Demerit
Body: <p>Currently, when I inspect the form structure in CiviCRM using CRM_Core_Error::debug($form), the output is presented as text, which makes it difficult  to investigate.
  <a href="https://i.sstatic.net/9Vdn2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9Vdn2.png" alt="enter image description here" /></a></p>
  <p>I'd like to find a way to make the output of CRM_Core_Error::debug($form) more user-friendly and similar to Drupal's Devel module's expandable items. I tried using krumo($form), but it didn't work. Any suggestions?
  <a href="https://i.sstatic.net/q51S3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/q51S3.png" alt="enter image description here" /></a></p>
  
Tags: <drupal><forms><debugging>
Title: Is it possible to change the output of CRM_Core_Error::debug($form)?
ThreadText: # Is it possible to change the output of CRM_Core_Error::debug($form)?
  
  (Asked by: username_0 on 2023-05-28)
  
  Currently, when I inspect the form structure in CiviCRM using CRM\_Core\_Error::debug($form), the output is presented as text, which makes it difficult to investigate.
  [![enter image description here](https://i.sstatic.net/9Vdn2.png)](https://i.sstatic.net/9Vdn2.png)
  
  I'd like to find a way to make the output of CRM\_Core\_Error::debug($form) more user-friendly and similar to Drupal's Devel module's expandable items. I tried using krumo($form), but it didn't work. Any suggestions?
  [![enter image description here](https://i.sstatic.net/q51S3.png)](https://i.sstatic.net/q51S3.png)
  
  **Tags:** drupal, forms, debugging
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-05-28. Score: 1
  
  Yes, you can do similar to CRM\_Core\_Error::debug\_var but using the html dumper:
  
  ```
  $dumpForm = (new \Symfony\Component\VarDumper\Dumper\HtmlDumper('php://output'))
    ->dump((new \Symfony\Component\VarDumper\Cloner\VarCloner())->cloneVar($form));
  CRM_Core_Error::debug($dumpForm);
  
  ```
  
  and then there's little expandy triangles on the right of expandable lines:
  
  [![enter image description here](https://i.sstatic.net/SNET0.png)](https://i.sstatic.net/SNET0.png)
  
  
  ---
  
  