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

View Laravel Package

hyperf/view

hyperf/view is the view rendering component for the Hyperf framework, providing a simple, configurable way to render templates with support for popular engines such as Twig, Blade, and Smarty. It integrates cleanly with Hyperf's container and lifecycle, making dynamic HTML views easy to build and ma...

Deep Wiki
Context7

hyperf/view is the view rendering component for the Hyperf framework, providing a lightweight abstraction for integrating template engines into coroutine-based PHP applications. It offers a consistent API for configuring engines and rendering templates, helping separate presentation from application logic.

  • Pluggable template engine architecture
  • Built-in support for Blade, Twig, Smarty, and Plates
  • Configurable template paths and engine options
  • Coroutine-friendly integration with Hyperf’s DI and configuration
  • Simple ViewInterface rendering API
Frequently asked questions about View
What is hyperf/view used for?
hyperf/view is the view rendering component for the Hyperf framework. It provides a unified view manager and adapters for engines such as Blade, Smarty, Twig, and Plates so templates stay separate from application logic in coroutine-based PHP services.
Is hyperf/view a Laravel package?
No. hyperf/view is built for Hyperf, not Laravel, although its view manager and Blade adapter will feel familiar to Laravel developers. For a Laravel application you should use Laravel's own view layer or illuminate/view instead of adding this package.
How do I install hyperf/view in a Hyperf project?
Install it with Composer using composer require hyperf/view, then add the adapter package for the template engine you want. Configure the engine and view paths in Hyperf's config/autoload/view.php file and make sure the compiled view cache directory is writable.
Does hyperf/view support Laravel Blade templates?
Yes, hyperf/view includes a Blade adapter, so you can use Blade-style templates in Hyperf. It is not the full Laravel Blade runtime, so Laravel-specific helpers and directives may need to be added or avoided. Test any Blade features that depend on Laravel framework internals.
Which template engines can I use with hyperf/view?
The component is designed around adapters, with support for popular engines such as Blade, Smarty, Twig, and Plates. You install and configure the adapter for your chosen engine rather than relying on one hard-coded renderer. This keeps template syntax flexible across Hyperf services.
Is hyperf/view compatible with Laravel 10 or Laravel 11?
hyperf/view does not target Laravel 10 or Laravel 11; it is a Hyperf component. Laravel applications should use Laravel's built-in view system or illuminate/view for version-matched support. The Blade adapter offers similar syntax but is not a Laravel compatibility layer.
How do I configure the view engine and view paths in Hyperf?
Configuration typically lives in config/autoload/view.php, where you select the adapter and set options such as the view path and cache path. Each adapter may expose its own engine-specific settings, so check the adapter documentation. Keep paths absolute or correctly resolved for your Hyperf deployment.
Is hyperf/view safe to use in coroutine-based Hyperf services?
The component is part of the Hyperf ecosystem and is intended for coroutine-based services. As with any view layer, avoid sharing mutable state between requests and verify that custom directives or engine extensions are coroutine-safe. Load-test rendering under concurrent requests before production.
How can I test views rendered with hyperf/view?
Write tests that dispatch a request or call the controller and assert the rendered response body contains the expected output. You can also test the view manager directly with a temporary view path and cache directory. Clear compiled templates between test runs to avoid stale cache results.
What are alternatives to hyperf/view, and is it actively maintained?
For Laravel applications, use Laravel's built-in Blade compiler or illuminate/view rather than hyperf/view; Twig bridges are another option. For Hyperf projects, hyperf/view is the standard integration point for Blade, Twig, Smarty, and Plates. It is maintained as part of the Hyperf ecosystem, so pin compatible versions and review release notes when upgrading Hyperf.
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.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
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