Download the PHP package quellabs/canvas-plates without Composer
On this page you can find all versions of the php package quellabs/canvas-plates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quellabs/canvas-plates
More information about quellabs/canvas-plates
Files in quellabs/canvas-plates
Package canvas-plates
Short Description Plates template engine integration for the Canvas PHP framework
License MIT
Homepage https://github.com/quellabs/canvas-plates
Informations about the package canvas-plates
Plates Template Engine for Canvas Framework
A Plates template engine implementation for the Canvas PHP framework that provides a consistent interface for template rendering operations.
Features
- Interface Compliance: Implements
TemplateEngineInterfacefor consistent template engine operations - Native PHP Templates: No new syntax to learn — templates are plain PHP files
- Global Variables: Support for framework-wide template variables
- Custom Functions: Easy registration of custom functions accessible in all templates
- String Templates: Render templates from strings as well as files
- Multiple Template Paths: Support for namespaced template directories (Plates "folders")
Installation
Install the package via Composer:
The package includes Plates as a dependency and automatically copies the configuration file to /config/plates.php. No additional setup is required - just register the service provider in your Canvas framework configuration.
Configuration
The package automatically creates a configuration file at config/plates.php during installation.
Selecting the Default Template Engine
To use Plates as the default template engine across your application, set the following in config/app.php:
Once set, rendering templates in your controllers works as normal:
If you need to mix multiple template engines in the same project, you can request a specific engine explicitly via the container:
Error Handling
The template engine provides detailed error messages for common issues:
Custom Functions
Register custom functions in config/plates.php and call them inside templates via $this->functionName(...):
Namespaced Template Folders
Register additional template directories with a namespace in config/plates.php:
Then reference them in templates or render calls using Plates' double-colon syntax:
Requirements
- PHP 8.2 or higher
- Canvas Framework with TemplateEngineInterface
License
MIT License
All versions of canvas-plates with dependencies
quellabs/dependency-injection Version ^1.
quellabs/contracts Version ^1.
quellabs/sculpt Version ^1.
quellabs/support Version ^1.