Render
Coordinates template rendering, content selection, template loading, output generation and response delivery.
Purpose
Coordinates template rendering, content selection, template loading, output generation and response delivery.
Rendering lifecycle
The renderer initializes its dependencies, resolves content and templates, supplies variables, and produces or sends the final response. View slots allow the surrounding layout to incorporate independently registered views.
Public API Reference
Core\Render
Class & Registry
Class:
Core\Render
Extends:
Core\Render\Base
use Core\Render;
use Core\Registry;
$render = Registry::get(Render::class);
| Method | Description |
|---|---|
public function set(string $key, mixed $value,): void |
Set render variable |
public function assign(string $key, mixed $value,): void |
Assign render variable Provides an alias for set(). |
public function get(string $key, mixed $default = null,): mixed |
Get render variable |
public function setContent(array|string $content): void |
Set render content views Accepts a single rendered view or multiple views. Non-string and empty values from array input are removed and |
public function getContent(): array |
Get render content views |
public function template(string $template, array $variables = [],):
void
|
Add template to render stack |
public function load(string $template, array $variables = [],):
string|null
|
Load template and return rendered string Provides an alias for fetch(). |
public function fetch(string $template, array $variables = [],):
string|null |
Fetch template and return rendered string Resolves the requested template through Core\Files, builds the final template variable collection and renders the |
public function send(): string |
Send rendered output Explicit template stacks have the highest rendering priority and are rendered sequentially. |
Context implementations
APPNETOS provides application and administration implementations of this controller. Use the class mapped for the active runtime context; shared base classes describe common behavior, while concrete implementations may supply context-specific dependencies.