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:
@@ -411,21 +411,17 @@ class Feature_Index_Action extends Spa_Action {
|
|||||||
</Define:Feature_Index_Action>
|
</Define:Feature_Index_Action>
|
||||||
```
|
```
|
||||||
|
|
||||||
**4. Update Controller**
|
**4. Update Controller - Remove server-side route entirely:**
|
||||||
```php
|
```php
|
||||||
// Change #[Route] to #[SPA]
|
// Remove #[Route] method completely. Add Ajax endpoints:
|
||||||
#[SPA]
|
|
||||||
public static function index(Request $request, array $params = []) {
|
|
||||||
return rsx_view(SPA);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add Ajax endpoints
|
|
||||||
#[Ajax_Endpoint]
|
#[Ajax_Endpoint]
|
||||||
public static function fetch_items(Request $request, array $params = []): array {
|
public static function fetch_items(Request $request, array $params = []): array {
|
||||||
return ['items' => Feature_Model::all()];
|
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**
|
**5. Update Route References**
|
||||||
|
|
||||||
**Search entire codebase for old route references:**
|
**Search entire codebase for old route references:**
|
||||||
|
|||||||
Reference in New Issue
Block a user