CodeIgniter v4.5 API

RendererInterface

Interface RendererInterface

The interface used for displaying Views and/or theme files.

Table of Contents

Methods

render()  : string
Builds the output based upon a file name and any data that has already been set.
renderString()  : string
Builds the output based upon a string and any data that has already been set.
resetData()  : RendererInterface
Removes all of the view data from the system.
setData()  : RendererInterface
Sets several pieces of view data at once.
setVar()  : RendererInterface
Sets a single piece of view data.

Methods

render()

Builds the output based upon a file name and any data that has already been set.

public render(string $view[, array<string, mixed>|null $options = null ][, bool $saveData = false ]) : string
Parameters
$view : string
$options : array<string, mixed>|null = null

Reserved for 3rd-party uses since it might be needed to pass additional info to other template engines.

$saveData : bool = false

Whether to save data for subsequent calls

Return values
string

renderString()

Builds the output based upon a string and any data that has already been set.

public renderString(string $view[, array<string, mixed>|null $options = null ][, bool $saveData = false ]) : string
Parameters
$view : string

The view contents

$options : array<string, mixed>|null = null

Reserved for 3rd-party uses since it might be needed to pass additional info to other template engines.

$saveData : bool = false

Whether to save data for subsequent calls

Return values
string

setData()

Sets several pieces of view data at once.

public setData([array<string, mixed> $data = [] ][, non-empty-string|null $context = null ]) : RendererInterface
Parameters
$data : array<string, mixed> = []
$context : non-empty-string|null = null

The context to escape it for. If 'raw', no escaping will happen.

Tags
phpstan-param

null|'html'|'js'|'css'|'url'|'attr'|'raw' $context

Return values
RendererInterface

setVar()

Sets a single piece of view data.

public setVar(string $name[, mixed $value = null ][, non-empty-string|null $context = null ]) : RendererInterface
Parameters
$name : string
$value : mixed = null
$context : non-empty-string|null = null

The context to escape it for. If 'raw', no escaping will happen.

Tags
phpstan-param

null|'html'|'js'|'css'|'url'|'attr'|'raw' $context

Return values
RendererInterface

        
On this page

Search results