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 | $_body | The body |
|
| protected | $_content | The content |
|
| protected | $_currentBuffer | The content buffer |
|
| protected | $_head | The head |
|
| protected | $_layout | The layout |
|
| protected | $_outputBuffer | The output buffer |
|
| protected | $_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 57
__construct()
Default constructor.
at line 70
void
addWidget(string $section, string $viewPath, array $data = [])
Registers a new widget.
at line 82
void
component(string $component, bool $frameworkComponentPath = false)
Includes a component into a view.
at line 101
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 113
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 131
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 = [], string $entry = 'resources/js/app.jsx')
Renders a React.js file.
at line 184
string
renderWidget(string $viewPath, array $data = [])
Renders a single widget view file with given data.
at line 205
string
renderWidgets(string $slot, array $widgets = [])
Renders widgets for a given section.
at line 227
void
setLayout(string $path)
Sets the layout for the view.
at line 237
void
setSiteTitle(string $title)
Setter function for site title of current page.
at line 246
string
siteTitle()
Getter function for current page's site title.
at line 259
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.