ajustes codex
This commit is contained in:
12
CLAUDE.md
12
CLAUDE.md
@@ -73,6 +73,18 @@ PHP files that execute server-side logic. Triggered by:
|
||||
- JavaScript: `CmsApi.hook('/hooks/module_id/', {param: value}, callback)`
|
||||
- Form action: via `c-form` attribute
|
||||
|
||||
There are two valid hook locations:
|
||||
- Global hooks in `hooks/hooks.<hook-id>.php` for reusable/shared server-side logic
|
||||
- Module-specific hooks in `template/estandar/modulos/<module-id>/hook.php` for logic owned by a single module
|
||||
|
||||
How to reference them:
|
||||
- Global hook `hooks/hooks.calcular_precio.php` -> endpoint `/hooks/calcular_precio/`
|
||||
- Module hook `template/estandar/modulos/hero_banner/hook.php` -> endpoint `/hooks/hero_banner/`
|
||||
|
||||
Rule of thumb:
|
||||
- If the logic is only used by one module, prefer that module's `hook.php`
|
||||
- If the logic will be reused by several modules/pages, create a global hook in `hooks/`
|
||||
|
||||
See [docs/hooks-and-api.md](docs/hooks-and-api.md) for usage.
|
||||
|
||||
## Database Access
|
||||
|
||||
Reference in New Issue
Block a user