class View (View source)

Constants

UNSAFE

Methods

static 
setEncoding($value)

Set encoding used by escape engine

static 
forceRender()

Force the View::render method to render at the time it is called

static 
dispatch()

Starts rendering of registered views.

static 
data(string $key, mixed $value)

Share or remove shared data to Views, shared variables will be added as variables to the views that will be executed later

static bool
exists(string $view)

Check if view exists in ./application/View/ folder

static int|null
render(string $view, array $data = array(), int $mode = ENT_QUOTES)

Register or render a View. If View is registered this method returns the index number from View

static 
remove(int $index)

Remove a registered View by index

Details

static setEncoding($value)

Set encoding used by escape engine

Parameters

$value

static forceRender()

Force the View::render method to render at the time it is called

static dispatch()

Starts rendering of registered views.

Executes all registered views and forces immediate rendering for subsequent calls.

static data(string $key, mixed $value)

Share or remove shared data to Views, shared variables will be added as variables to the views that will be executed later

Parameters

string $key
mixed $value

static bool exists(string $view)

Check if view exists in ./application/View/ folder

Parameters

string $view

Return Value

bool

static int|null render(string $view, array $data = array(), int $mode = ENT_QUOTES)

Register or render a View. If View is registered this method returns the index number from View

Parameters

string $view

View path

array $data

Array that will be extracted to variables in the view

int $mode

Supported flags (may vary depending on the version):

  • ENT_COMPAT
  • ENT_QUOTES
  • ENT_NOQUOTES
  • ENT_IGNORE
  • ENT_SUBSTITUTE
  • ENT_DISALLOWED
  • ENT_HTML401
  • ENT_XML1
  • ENT_XHTML
  • ENT_HTML5

Return Value

int|null

static remove(int $index)

Remove a registered View by index

Parameters

int $index