> For the complete documentation index, see [llms.txt](https://docs.strata.dev/frontend/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.strata.dev/frontend/templating/debugging.md).

# Debugging

## Symfony debugger

On your local development environment you will see the Symfony debug bar which displays:

![Symfony debugger](/files/QbQqXYkIwyubWC1a2TcS)

* HTTP status code
* Matching route
* Page generation time and memory usage
* Twig template generation time

### Inspecting template variables

The controller defines the variables to pass onto the view. Example controller code:

```php
return $this->render('news/article.html.twig', [
    'url' => sprintf('/news/%s', $slug),
    'page' => $page
]);
```

You can then inspect the variable via the `dump()` command.

When used in your template, this will output the variable directly to the page. E.g.

```
{{ dump(page) }}
```

![Inspecting a variable via debug (in a template)](/files/ewyJEg0KluW8SNmj2Zzb)

The above example shows the `page` object which represents, in this instance, a news post from WordPress.

The inspector shows the object types for each content field, you can find out more about these at [Content Fields](broken://pages/GpdqMd6lTLgZKB1W6GMM).

### Inspecting variables in PHP

You can also use the `dump()` function in PHP, this will output the variable to the Symfony debugger inspector. E.g.

```
dump($page);
```

Select the inspector icon ![Inspector icon](/files/XJVp0iYq64AHYwEtNt0n) to inspect the variable.

![Inspecting a variable via debug (in PHP)](/files/0Ygg02kq1YLr5TiopOm7)

The example above also shows the debug bar with an error, additional information such as the error details can be accessed from here.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.strata.dev/frontend/templating/debugging.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
