Fix incorrect SPA conversion instructions in CLAUDE.dist.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-19 23:54:09 +00:00
parent d341d7a2e2
commit e9a8157e7a

View File

@@ -411,21 +411,17 @@ class Feature_Index_Action extends Spa_Action {
</Define:Feature_Index_Action>
```
**4. Update Controller**
**4. Update Controller - Remove server-side route entirely:**
```php
// Change #[Route] to #[SPA]
#[SPA]
public static function index(Request $request, array $params = []) {
return rsx_view(SPA);
}
// Add Ajax endpoints
// Remove #[Route] method completely. Add Ajax endpoints:
#[Ajax_Endpoint]
public static function fetch_items(Request $request, array $params = []): array {
return ['items' => Feature_Model::all()];
}
```
**CRITICAL**: Do NOT add `#[SPA]` to feature controllers. The `#[SPA]` attribute only exists in the bootstrap controller (e.g., `Frontend_Spa_Controller::index`). Feature controllers should only contain `#[Ajax_Endpoint]` methods for data fetching.
**5. Update Route References**
**Search entire codebase for old route references:**