# Templates

This folder holds the overridable view templates that ship with **Business Central Connector**. Templates are loaded by `Synfynal\BusinessCentralConnector\Support\View` (`src/Support/View.php`), which exposes data to each template as a single `$data` array.

## Overriding a template from a theme

Any template here can be overridden by your theme. Copy the file into your theme, preserving its relative path under a `businesscentralconnector/` directory, and edit your copy:

```
templates/<path>.php
        ↓ copy to
{your-theme}/businesscentralconnector/<path>.php
```

That is, a template at `templates/<path>.php` is overridden by placing a file at `{theme}/businesscentralconnector/<path>.php`.

## Resolution order

When rendering, `View` resolves a template in this order and uses the first match:

1. **Theme override** — `{theme}/businesscentralconnector/<path>.php`
2. **Plugin default** — `<plugin>/templates/<path>.php`

The theme lookup uses the standard WordPress `locate_template()`, so both parent and child themes participate (child theme wins over parent).

Each template receives its data as `$data`; always escape values on output.
