{ "type": "paragraph", "data": { "text": "This is a block-based CMS." } }
]
```
### 3.2 Rendering Flow
- **On Save**: The Svelte editor outputs JSON. The PHP core hydrates this JSON into a "Cached Rendered HTML" column in the database.
- **On Request**: The CMS serves the "Cached Rendered HTML" for high performance.
- **Fallback**: If the cached version is missing/outdated, the PHP core re-hydrates the JSON on-the-fly using Blade components associated with each block type.
## 4. Plugin & Theme Architecture
### 4.1 Plugin Lifecycle
- **Discovery**: CMS scans the `/plugins` directory for Service Providers.
- **Activation**: Toggle-based via Admin UI.
- **Migrations**:
- Plugins can define a custom migration path in the Service Provider.
-`sw_file('path', $attributes)`: **Smart Asset Helper**. Automatically detects file type (via extension/metadata) and outputs the appropriate HTML tag (`<img>` with `srcset` support, `<video>`, `<audio>`, or `<a>` for documents like PDF).
- **JIT Image Parameters**: For images, special keys in the `$attributes` array like `w`, `h`, `fit`, `q` (quality), and `fm` (format) are automatically intercepted and passed to the JIT image generation engine.
- **Functionality**: These helpers output the **FULL HTML TAG**.
- **Attributes**: The optional `$attributes` array allows for specifying `defer`, `async`, `media`, `id`, `class`, `alt`, `w`, `h`, etc.
- **Recursive Search**: The engine first looks in the current Theme folder. If a Child Theme is active and the file is missing, it automatically falls back to the Parent Theme folder.