View
class View
Properties
| static int | $parsing_progressive | Progressive counter for parsing operations. |
|
| static array | $available_source_paths | List of available source paths for views. |
|
| static array | $available_modules_source_paths |
Methods
Creates a new instance.
Adds a source path for modules views with a namespace.
Adds a source path for views, optionally with a namespace.
Initialize all source paths from configuration.
Throw an exception when a view is not found
Check if a view exists
Get a module view from filename
Get a view from filename
Get the view path
Get the view arguments
Set section position inside the view
Starts style section.
Stops style section.
Starts script section.
Stops script section.
Starts a section.
Stops a section.
Merge view sections content with given sections content
Sets the section content
Compile the view content
Resolve and build the view.
Build and print the view.
Returns a string representation of the object.
Details
at line 71
__construct(string $view_path = "", array $args = [])
Creates a new instance.
at line 87
static
addModuleSourcePath(string $path, string $namespace)
Adds a source path for modules views with a namespace.
at line 102
static
addSourcePath(string $path, string|null $namespace = null)
Adds a source path for views, optionally with a namespace.
at line 120
static
initSourcePaths()
Initialize all source paths from configuration.
Loads view paths from the configuration and registers them for each section.
at line 133
static
notFound(string $view)
Throw an exception when a view is not found
at line 144
static bool
exists(string $path)
Check if a view exists
at line 156
static View
module(string $filename, array $args = [])
Get a module view from filename
at line 191
static View
get(string $filename, array $args = [])
Get a view from filename
at line 227
string
getPath()
Get the view path
at line 236
array
getArguments()
Get the view arguments
at line 245
parent(View $parent)
Set the view parent
at line 255
section(string $name, string|null $default = null)
Set section position inside the view
at line 262
start_style()
Starts style section.
at line 275
stop_style(array|null $options = [])
Stops style section.
at line 312
start_script()
Starts script section.
at line 325
stop_script(array|null $options = [])
Stops script section.
at line 367
start_section(string $name, string|null $content = null)
Starts a section.
at line 379
stop_section()
Stops a section.
at line 391
mergeSections(array $sections)
Merge view sections content with given sections content
at line 406
setSectionContent(string $name, string $content)
Sets the section content
If the section does not exist it will be first filled with an empty string. If it exists, and a child view has a section with the same name, it is concatenated to have the order parent + child.
at line 421
string
compile()
Compile the view content
at line 435
string
build()
Resolve and build the view.
at line 448
render()
Build and print the view.
at line 459
string
__toString()
Returns a string representation of the object.
When you print the \App\System\MVC\View object Eg. using echo