Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Template Bundle

Php Template Bundle Laravel Package

nyrodev/php-template-bundle

A Symfony bundle by nyrodev that adds PHP-based templating support to your application, with helpers and utilities for rendering views directly in PHP instead of relying on a separate template engine. Lightweight, simple to configure, and easy to drop into existing Symfony projects.

View on GitHub
Deep Wiki
Context7

Symfony Bundle in order to keep using PHP template

Frequently asked questions about Php Template Bundle
Is nyrodev/php-template-bundle a Laravel package?
It is not. Despite sometimes being listed alongside Laravel packages, it is a Symfony bundle that registers through Symfony's Kernel and a DI Extension with a Configuration tree. There is no Laravel service provider or extra.laravel block, so Composer autodiscovery does nothing in a Laravel app.
Can I install nyrodev/php-template-bundle in a Laravel application?
Installing it is not useful because Laravel has no seam it can hook into; its view layer is Illuminate\View with EngineResolver, FileViewFinder and Blade, not Symfony's templating component. You would have to reimplement the behavior rather than use the package. The underlying idea is small though: a plain-PHP engine is roughly one class implementing EngineInterface using extract, ob_start and include.
How do I install and register the bundle in Symfony?
Install it with Composer, then register it in config/bundles.php so Symfony's Kernel boots it. It integrates through a DI Extension and Configuration tree, and most likely relies on the symfony/templating component's PhpEngine and template-guessing machinery. Confirm the supported Symfony and PHP versions with the maintainer before pinning it.
Which Symfony versions does nyrodev/php-template-bundle support?
It likely targets Symfony 4.x or earlier, because the symfony/templating component was deprecated in 4.3 and removed in 5.0. If the bundle depends on that component, its usable surface stops at Symfony 4.x. That makes it legacy for any modern application that pulls Symfony 6 or 7 components.
Will nyrodev/php-template-bundle work with Laravel 10 or Laravel 11?
No. A Laravel app already depends on symfony/http-foundation, console, finder and process, and pinning an old symfony/templating alongside them is a likely dependency-solver dead end. Run composer why-not before any design work to confirm the conflict in minutes. Even if the solve passed, the bundle still has no way to register itself in Laravel.
How do I render plain PHP templates in Laravel without Blade?
Register a custom engine with View::addExtension('php', 'php') backed by a class implementing Illuminate\Contracts\View\Engine. A minimal engine calls extract() on the data, starts output buffering, includes the template file and returns the buffer. That is a one to two day spike and lets you call view('legacy.report', $data) alongside normal Blade views without importing a Symfony bundle's lifecycle.
Are PHP templates a security risk compared to Blade?
Yes, meaningfully. PHP templates are executed code with no sandboxing, and unlike Blade's escaped output, plain PHP does not auto-escape by default. Any template authored by a non-engineer, or worse stored in a database, becomes a direct remote code execution vector. If content editors touch templates, auto-escaping and strict template locations are mandatory.
Is nyrodev/php-template-bundle actively maintained and production ready?
Adoption signals are thin: roughly 2 stars, zero dependents and a single maintainer with no visible CI or test suite to audit. Zero dependents also means zero field-tested failure modes you can learn from. Treat it as a pattern reference rather than a production dependency.
What are the alternatives for keeping legacy PHP templates during a Laravel migration?
The pragmatic path is a custom PHP view engine registered through View::addExtension, rendering existing templates unmodified. From there, migrate high-churn views to Blade first and delete the engine once the count reaches zero. This keeps legacy views working without pulling Symfony bundle machinery into Laravel.
What should I verify before adopting nyrodev/php-template-bundle?
Confirm which Symfony and PHP versions are actually supported and whether it requires symfony/templating. Clarify whether the real requirement is rendering legacy .php templates during a migration or avoiding Blade entirely, since those have very different answers. Also establish how many templates exist and who authors them, because that decides whether auto-escaping is mandatory.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager