quellabs / canvas-smarty
Smarty template engine integration for the Canvas PHP framework with contextual containers and automatic service discovery
1.0.0
2025-06-03 06:54 UTC
Requires
- quellabs/contracts: ^1.0
- quellabs/dependency-injection: ^1.0
- quellabs/discover: ^1.0
- quellabs/sculpt: ^1.0
- smarty/smarty: ^4.3|^5.0
README
A Smarty template engine integration for the Canvas PHP framework.
Installation
composer require quellabs/canvas-smarty
Requirements
- PHP 8.3 or higher
- Canvas framework
Usage
The Smarty template engine is automatically registered with Canvas through the service discovery system. No manual configuration required.
// In your Canvas controller class HomeController { public function index(TemplateEngineInterface $smarty) { return $smarty->render('home.tpl', [ 'title' => 'Welcome to Canvas', 'user' => $user ]); } }
Template Files
Place your Smarty templates in your Canvas application's template directory:
templates/
├── home.tpl
├── layouts/
│ └── app.tpl
└── partials/
└── header.tpl
License
MIT License