Fastpress View is a powerful and flexible templating engine for PHP, designed to render views and manage layouts seamlessly within the Fastpress framework.
Use Composer to install Fastpress View into your project:
composer require fastpress/view
Renders a view with the given data.
Parameters:
$view
: The name of the view file.$data
: An array of data to pass to the view.
Returns:
- The
View
instance.
Extends a layout.
Parameters:
$layout
: The name of the layout file.
Returns:
- The
View
instance.
Starts a template block.
Parameters:
$name
: The name of the block.
Returns:
- The
View
instance.
Ends a template block.
Parameters:
$name
: The name of the block (optional).
Returns:
void
Outputs the content of a template block.
Parameters:
$name
: The name of the block.
Returns:
void
Shares data across all views.
Parameters:
$key
: The key for the shared data.$value
: The value of the shared data.
Returns:
- The
View
instance.
Escapes HTML special characters in a string.
Parameters:
$value
: The value to escape.
Returns:
- The escaped string.
Sets an application configuration value.
Parameters:
$key
: The configuration key.$value
: The configuration value.
Returns:
void
Gets an application configuration value.
Parameters:
$key
: The configuration key.
Returns:
- The configuration value.