Download the PHP package enflow/livewire-twig without Composer
On this page you can find all versions of the php package enflow/livewire-twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download enflow/livewire-twig
More information about enflow/livewire-twig
Files in enflow/livewire-twig
Package livewire-twig
Short Description Enabling Livewire in Twig templates
License MIT
Informations about the package livewire-twig
Livewire for Twig
The enflow/livewire-twig
package provides the option to load Livewire components in your Twig templates.
Versions
<= 3.x.x
Version 3.x.x supports Livewire 2.
>= 4.x.x
Version 4.xxx supports Livewire 3.
This version changes from the {% livewire.component test %}
syntax to the {% livewire.component 'test' %}
syntax.
The name argument for {% livewire.component %} and the other directives is now interpreted as an expression, allowing the use of variables or Twig expressions as a name. Note that for this reason a constant name now must be enclosed in quotes.
Installation
You can install the package via composer:
Usage
The Twig extension will automatically register when rcrowe/twigbridge
is used.
If you're using another configuration, you may wish to register the extension manually by loading the extension Enflow\LivewireTwig\LivewireExtension
.
This package provides wrappers for the @livewireScripts
, @livewireStyles
, @livewireScriptConfig
, @livewire
, @entangle
, @this
and @persist
, directives. Everything else under the hood is powered by livewire/livewire
.
You can register your Livewire components like normal.
To use Livewire, add the following tags in the head
tag, and before the end body
tag in your template.
In your body you may include the component like:
Example
Add the following to resources/views/livewire/counter.twig
Add the following to app/Http/Livewire/Counter.php
Todo
- [ ] Moar tests.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Michel Bardelmeijer
- All Contributors
About Enflow
Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info on our website.
License
The MIT License (MIT). Please see License File for more information.