$kirby->render()
Returns the Response object for the current request
$kirby->render(string|null $path = null, string|null $method = null): Kirby\Http\Response|null
Parameters
Name | Type | Default |
---|---|---|
$path | string ornull |
null
|
$method | string ornull |
null
|
Return types
Kirby\Http\Response
ornull
This method modifies the existing $app
object it is applied to and returns it again.
Parent class
Disabling the render method
$kirby->render()
can be disabled temporarily by setting
$_ENV['KIRBY_RENDER'] = false;
This needs to be set before $kirby->render()
is called.
As an example, this is used by the Kirby CLI to load the index.php
without getting any output. This way, the CLI can access the correct $kirby
instance with all custom roots and options.
If one of your independent PHP scripts need access to the $kirby
instance in a similar way, you can require the index.php
like this …
<?php
$_ENV['KIRBY_RENDER'] = false;
// Kirby will not render anything
require __DIR__ . '/index.php';
// You get full access to the $kirby object
// with all custom settings
dump($kirby);