Integrations
Learn how to integrate the Tplix PHP template engine with popular frameworks including Laravel, Symfony, CodeIgniter, Yii, Slim, Laminas, CakePHP, Phalcon, FuelPHP, and Hyperf. Step-by-step code examples for every framework.
Plug Tplix into Any PHP Framework
Tplix is framework-agnostic. One Composer install is all it takes — then follow the guide for your framework below.
composer require tplix/tplix
Choose your framework
Laravel
v9 · v10 · v11Register as a singleton in a service provider and inject via Laravel's DI container.
Symfony
v5 · v6 · v7Wire Tplix into the Symfony service container via a YAML factory definition.
CodeIgniter
CI3 · CI4Simple library wrapper for CI3 and a namespace-aware service class for CI4.
Yii 2
v2.xRegister a Tplix component in the application config and use it from any controller.
Slim
v4Register in the PHP-DI container and inject into route handlers or action classes.
Laminas
MVC · MezzioWire Tplix through the Laminas service manager factory in module config.
CakePHP
v4 · v5Create a custom View class extending CakePHP's base View and set it per controller.
Phalcon
v5Register as a shared service in Phalcon's FactoryDefault DI container.
FuelPHP
v1.xWrap Tplix in a FuelPHP-style static class and load it as an application package.
Hyperf
v3 · SwooleRegister as a singleton in Hyperf's DI container with a Swoole-safe clear-assign pattern.
Every Integration Follows the Same Pattern
Framework-specific wiring differs, but the Tplix API is always identical.
Get Instance
Tplix is a singleton — call once, share everywhere.
Assign Variables
Pass any PHP value — arrays, objects, scalars.
Fetch Template
Returns rendered HTML. Return it as the response.