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 119
static
initSourcePaths()
Initialize all source paths from configuration.
Loads view paths from the configuration and registers them for each section.
at line 132
static
notFound(string $view)
Throw an exception when a view is not found
at line 143
static bool
exists(string $path)
Check if a view exists
at line 155
static View
module(string $filename, array $args = [])
Get a module view from filename
at line 192
static View
get(string $filename, array $args = [])
Get a view from filename
at line 228
string
getPath()
Get the view path
at line 237
array
getArguments()
Get the view arguments
at line 246
parent(View $parent)
Set the view parent
at line 256
section(string $name, string|null $default = null)
Set section position inside the view
at line 263
start_style()
Starts style section.
at line 276
stop_style(array|null $options = [])
Stops style section.
at line 313
start_script()
Starts script section.
at line 326
stop_script(array|null $options = [])
Stops script section.
at line 368
start_section(string $name, string|null $content = null)
Starts a section.
at line 380
stop_section()
Stops a section.
at line 392
mergeSections(array $sections)
Merge view sections content with given sections content
at line 407
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 422
string
compile()
Compile the view content
at line 439
string
build(bool $minify = false)
Resolve and build the view.
at line 458
render(bool $minify = false)
Build and print the view.
at line 469
string
__toString()
Returns a string representation of the object.
When you print the \App\System\MVC\View object Eg. using echo