Download the PHP package verbant/wn-livewire-plugin without Composer

On this page you can find all versions of the php package verbant/wn-livewire-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wn-livewire-plugin

Livewire for WinterCMS

The verbant/wn-livewire-plugin package provides the option to load Livewire components in WinterCMS projects.

Installation

You can install the package via composer:

Usage

This package supports Livewire components in a theme, in plugins or in the backend. Each of these usages requires a specific approach:

Theme usage

The plugin creates a menu entry in the top menubar, ¨Livewire¨ and a ¨Conponents¨ side menu entry. You can add a new component or modify an existing one. The Markup tab contains the Livewire-markup, the code tab contains the Livewire PHP-class containing the callback functions.

Plugin component usage

Component registration

Component and backend Livewire components require registration, so that Livewire can find the markup and its backing class. You register these components by creating a public function registerLivewireComponents() returning information for the components as an array. Each element of this array has the following layout:

Component usage

A plugin can define a component which has both Livewire-markup and a Livewire PHP-class. You can still have other component partials, and render these in the usual way using the twig directive. The Livewire-markup is rendered by the {% component %} directive and renders the markup as defined as the ViewName during registration.

Plugin backend usage

A plugin can have a backend controller which supports Livewire components. The markup will probably in the controllers/controller name directory. The Livewire PHP-class could be there as well. To render the Livewire-component, call

Installation

Add the following tags in the head tag, and before the end body tag in your page or layout.

Examples

Theme example

Create a Livewire component by choosing ¨Livewire¨ from the top bar en then ¨Add +¨ from the sidebar. Name it counter. On the markup tab, enter:

On the code tab, enter:

Note that the code editor flags an error on the top line. It doesn´t know that this code will be embedded in a class.

Create a page and on the markup tab enter:

And add the {{ livewireStyles() }} and {{ livewireScripts() }} on this page or on a layout, used by it.

Plugin component example

Create a plugin and a component named ¨lw¨ within that plugin. In the Plugin.php file include:

In the components directory create a file Lw.php:

The LivewireComponent trait adds a onRender() function which takes care of rendering the markup as Liveewire markup.

In the components/lw directory create 2 files: default.twig with contents:

And Lw.php with contents:

You can now add this component to a CMS page by dragging it from the side bar. Note that you can pass variables to the component, which will be made available to the Livewire component, like

Backend example

Create a plugin and a controller named ¨lwc¨ within that plugin. In the Plugin.php file include:

In the controllers directory create a file Lwc.php:

The LivewireController trait provides the renderLivewire function.

In the controllers/lwc directory create 2 files: lwc.twig with contents:

And Lwc.php with contents:

You can now add this component to a backend view by calling

Note that for the backend you do not need to add the { livewireStyles() }} and {{ livewireScripts() }} directives.

License

The MIT License (MIT). Please see License File for more information.


All versions of wn-livewire-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
enflow/livewire-twig Version ~3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package verbant/wn-livewire-plugin contains the following files

Loading the files please wait ....