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 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

Technical Evaluation

Architecture fit — poor, and the premise needs correcting. Despite being filed as a "Laravel/PHP package," nyrodev/php-template-bundle is a Symfony bundle, not a Laravel package. It integrates through Symfony's Kernel bundle registration, a DI Extension with a Configuration tree, and — most likely — the symfony/templating component's PhpEngine and template-guessing machinery. Laravel has no equivalent seam: its view layer is Illuminate\View with EngineResolver, FileViewFinder, and Blade. There is no adapter, service provider, or extra.laravel block here, so Composer autodiscovery will do nothing useful. For a Laravel codebase, architecture fit is effectively zero.

Integration feasibility — not feasible as-is; feasible as a pattern reference. To make this run under Laravel you would have to reimplement its behavior rather than install it. The good news is that the underlying concept is genuinely small: Laravel's View facade exposes View::addExtension('php', 'php') and an EngineResolver, so a plain-PHP engine is roughly one class implementing EngineInterface (extract() + ob_start() + include). That is a 1–2 day spike, versus an unbounded effort to port a Symfony bundle. Net: the bundle's idea is integrable; the artifact is not.

Technical risk — high.

  • Version viability: The Symfony Templating component was deprecated in 4.3 and removed in 5.0. If this bundle depends on it, its usable surface is Symfony ≤4.x — legacy before it ever reaches a modern Laravel app, which itself pulls Symfony 6/7 components.
  • Composer conflict: A Laravel app already depends on symfony/http-foundation, console, finder, process, etc. Pinning an old symfony/templating alongside them is a likely dependency-solver dead end, and an unavoidable one if we also want security patches elsewhere in the tree.
  • Security posture: PHP templates are executed code. There is no sandboxing, and unlike Blade's {{ }}, PHP templates do not auto-escape. Any template authored by a non-engineer or (worse) stored in the database is a direct RCE vector.
  • Adoption signal: 2 stars, 0 dependents, opportunity score 17.34 against an overall score of 0.01. That gap is the tell — niche idea, no traction. Single-maintainer, no visible CI or test suite to audit.

Key questions for the maintainer/team:

  1. Which Symfony and PHP versions are actually supported, and does it require symfony/templating?
  2. What is the real requirement — "render legacy .php templates during migration," or "avoid Blade"? Those have very different answers.
  3. How many legacy templates exist, and who authors them (engineers vs. content editors)? This decides whether auto-escaping is mandatory.
  4. Is there any consumer we can point to? Zero dependents means zero field-tested failure modes.

Integration Approach

Stack fit. If the stack is Laravel: do not install this bundle. Treat it as a specification for a ~100-line custom EngineInterface registered via View::addExtension('php', 'php'), giving you view('legacy.report', $data) alongside Blade. If the stack is genuinely Symfony 4.4 LTS with a hard legacy-template requirement, the bundle is a defensible pin — but only inside that frozen boundary.

Migration path. For a Laravel target, the pragmatic sequence is: (1) spike the custom engine resolver, (2) render the existing PHP templates unmodified through it, (3) migrate high-churn views to Blade first, (4) delete the engine when the count hits zero. This keeps legacy views working without importing a Symfony bundle's lifecycle into a Laravel app.

Compatibility. Verify a composer why-not solve before any design work — that single command either kills or greenlights the idea in minutes. Check the Laravel↔Symfony component matrix, PHP ^8.x support, and whether the bundle's DI extension does anything at boot that assumes a Symfony container (it will).

Sequencing. Timebox a 1–2 day spike. Decision gate: if the composer solve conflicts, or if the engine cannot be exercised in under a day, stop and build in-house. Do not let this become a fork-maintenance commitment; the fork is the expensive outcome, not the integration.

Operational Impact

Maintenance — the dominant cost. Bus factor of one, zero dependents, no downstream users surfacing bugs. Adopting means we own the fork the moment the maintainer stops responding — and there is no evidence of active maintenance to rely on. Budget for vendoring or a hard fork from day one, or don't start.

Support. No vendor, no community. Issues are answered by whoever wrote the bundle, if at all. Internal ownership must be assigned explicitly; "the team owns it" is not an owner.

Scaling. Genuinely fine, and the one unambiguously positive note. PHP include-based rendering is Opcache-friendly and compiles to the same class of output Blade produces. Rendering throughput will not be the constraint; correctness, escaping, and maintainability will be.

Failure modes to plan for:

  • Composer lock: an unrelated composer update breaks the solve and blocks security patching across the app.
  • Symfony drift: upstream component removal (as with Templating) silently invalidates the bundle.
  • Escaping: missing auto-escaping produces XSS that code review will not reliably catch; a lint rule or mandatory e() wrapper is needed.
  • Trust boundary: any path where non-engineers can edit templates becomes a remote-code-execution surface. Gate it or forbid it.
  • Boot errors: Symfony DI assumptions surfacing as container exceptions in an environment that has no Symfony kernel.

Ramp-up. Low for engineers fluent in raw PHP templates; higher than it looks for everyone else. The team surrenders Blade's components, slots, directives, and auto-escaping, and documentation here is thin enough that institutional knowledge lives in one or two heads. Onboarding new engineers to a bespoke template layer is a recurring tax, not a one-time cost.

Recommendation. Do not adopt. The 0.01 score and zero dependents are accurate, not unlucky. If the requirement is real, implement the equivalent engine natively against Illuminate\View in a timeboxed spike — you get the same rendering behavior, full control of escaping, no Symfony coupling, and no fork obligation.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core