Class View

Summary

Fully Qualified Name: CodeIgniter\View\View
Implements: RendererInterface

Description

Class View

Methods

Name Description Defined By
__construct() Constructor View
endSection() View
excerpt() Extract first bit of a long string and add ellipsis View
extend() Specifies that the current view should extend an existing layout. View
getData() Returns the current data that will be displayed in the view. View
getPerformanceData() Returns the performance data that might have been collected during the execution. Used primarily in the Debug Toolbar. View
include() Used within layout views to include additional views. View
render() Builds the output based upon a file name and any data that has already been set. View
renderSection() Renders a section's contents. View
renderString() Builds the output based upon a string and any data that has already been set. View
resetData() Removes all of the view data from the system. View
section() Starts holds content for a section within the layout. View
setData() Sets several pieces of view data at once. View
setVar() Sets a single piece of view data. View

Method Details

__construct()

Constructor

Parameter Name Type Description
$config \Config\View
$viewPath string
$loader mixed
$debug bool
$logger \LoggerInterface

Returns:

endSection()

Returns:

excerpt()

Extract first bit of a long string and add ellipsis

Parameter Name Type Description
$string string
$length int

Returns: string

extend()

Specifies that the current view should extend an existing layout.

Parameter Name Type Description
$layout string

Returns: void

getData()

Returns the current data that will be displayed in the view.

Returns: array

getPerformanceData()

Returns the performance data that might have been collected during the execution. Used primarily in the Debug Toolbar.

Returns: array

include()

Used within layout views to include additional views.

Parameter Name Type Description
$view string
$options array|null
$saveData null

Returns: string

render()

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

Valid $options:

Parameter Name Type Description
$view string
$options array
$saveData bool

Returns: string

renderSection()

Renders a section's contents.

Parameter Name Type Description
$sectionName string

Returns:

renderString()

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

Cache does not apply, because there is no "key".

Parameter Name Type Description
$view string The
$options array Reserved
$saveData bool If

Returns: string

resetData()

Removes all of the view data from the system.

Returns: \RendererInterface

section()

Starts holds content for a section within the layout.

Parameter Name Type Description
$name string

Returns:

setData()

Sets several pieces of view data at once.

Parameter Name Type Description
$data array
$context string The

Returns: \RendererInterface

setVar()

Sets a single piece of view data.

Parameter Name Type Description
$name string
$value mixed
$context string The

Returns: \RendererInterface

Top