Skip to content

Commit 712340d

Browse files
authored
Organize and add error pages (#13)
1 parent e9dde17 commit 712340d

File tree

6 files changed

+502
-361
lines changed

6 files changed

+502
-361
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## Key Patterns & Conventions
1212

1313
- **Inertia Responses:**
14-
- Use `inertia()` for legacy responses, or `{% page('Component') %}` and `{{ prop('key', value) }}` for explicit, per-prop caching.
14+
- Use `{{ page('Component') }}` and `{{ prop('key', value) }}` for explicit, per-prop caching.
1515
- Each `prop()` call outputs an HTML comment marker (`<!--INERTIA_PROP:{...}-->`) for robust extraction.
1616
- Shared props: Place logic in `templates/_shared/` using `prop()`; these are auto-included.
1717
- **DRY Prop Extraction:**

src/Plugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public function init()
4848
Craft::$app->request->headers->set('X-Requested-With', null);
4949
Craft::$app->on(Application::EVENT_AFTER_REQUEST, [$this, 'applicationAfterRequestHandler']);
5050
Craft::$app->response->on(Response::EVENT_BEFORE_SEND, [$this, 'responseBeforeSendHandler']);
51+
52+
$this->setComponents([
53+
'renderer' => \rareform\inertia\services\Renderer::class,
54+
'errorHandler' => \rareform\inertia\services\ErrorHandler::class,
55+
]);
5156
}
5257

5358
// Any code that creates an element query or loads Twig should be deferred until

0 commit comments

Comments
 (0)