Output
Output
Output-buffer caching helper.
class Output extends \Hazaar\Cache\AdapterExtends the cache adapter with a simple begin/end output buffering workflow:
start($key)attempts to serve cached rendered output.- If no cached output exists, it starts buffering for dynamic rendering.
stop()captures the generated buffer, stores it in cache, and returns it.
This is useful for fragment/page-style output caching where rendering is expensive and the final result is plain text/HTML.
Properties
key
Cache key associated with the active output buffer cycle.
private string $keyMethods
start
Starts output buffering and retrieves cached content if available.
public start(string $key): stringThis method attempts to retrieve cached content associated with the given key. If the content is not found in the cache, it starts output buffering and returns false. If the content is found, it returns the cached content.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the key used to identify the cached content |
stop
Stops the output buffering, retrieves the buffer contents, stores it in the cache,
public stop(): stringand returns the buffer contents as a string.
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000