View
class View extends stdClass
Handles operations related to views and its content.
Constants
| private APP_COMPONENT_PATH |
The app component path |
| private APP_LAYOUT_PATH |
The app layout path |
| private APP_VIEW_PATH |
The app view path |
| private APP_WIDGET_PATH |
The app widget path |
| private FRAMEWORK_COMPONENT_PATH |
The framework component path |
| private FRAMEWORK_LAYOUT_PATH |
The framework layout path |
| private FRAMEWORK_VIEW_PATH |
The framework view path |
Properties
| protected array | $_content | The content |
|
| protected string|null | $_currentBuffer | The content buffer |
|
| protected string | $_layout | The layout |
|
| protected string | $_siteTitle | The site title |
|
| protected array | $widgets | An array of widgets. |
Methods
Default constructor.
Registers a new widget.
Includes a component into a view.
The content of the page. The two types are head and body. If necessary, we can implement additional types of content.
Sets the end for a particular section of content. When called it takes _outputBuffer, cleans it, and outputs it to the screen. In the absence of a previous call to the start() function a message requesting you to call start() is displayed.
Performs render operations for a particular view.
Renders a React.js file.
Renders a single widget view file with given data.
Renders widgets for a given section.
Sets the layout for the view.
Setter function for site title of current page.
Getter function for current page's site title.
When called this function establishes the beginning for a section of content. Anything between calls of this function and end() will be included in our view.
Details
at line 52
__construct()
Default constructor.
at line 65
void
addWidget(string $section, string $viewPath, array $data = [])
Registers a new widget.
at line 78
void
component(string $component, bool $frameworkComponentPath = false)
Includes a component into a view.
at line 97
mixed
content(string $type)
The content of the page. The two types are head and body. If necessary, we can implement additional types of content.
at line 109
void
end()
Sets the end for a particular section of content. When called it takes _outputBuffer, cleans it, and outputs it to the screen. In the absence of a previous call to the start() function a message requesting you to call start() is displayed.
at line 130
void
render(string $viewName, bool $frameworkViewPath = false, bool $frameworkLayoutPath = false)
Performs render operations for a particular view.
Example input: home/index.
at line 161
void
renderJsx(string $viewComponent, array $props = [], bool $frameworkLayoutPath = false, string $entry = 'resources/js/app.jsx')
Renders a React.js file.
at line 188
string
renderWidget(string $viewPath, array $data = [])
Renders a single widget view file with given data.
at line 209
string
renderWidgets(string $slot, array $widgets = [])
Renders widgets for a given section.
at line 231
void
setLayout(string $path)
Sets the layout for the view.
at line 241
void
setSiteTitle(string $title)
Setter function for site title of current page.
at line 250
string
siteTitle()
Getter function for current page's site title.
at line 263
void
start(string $type)
When called this function establishes the beginning for a section of content. Anything between calls of this function and end() will be included in our view.