Download the PHP package hello-sebastian/hello-stimulus-bundle without Composer

On this page you can find all versions of the php package hello-sebastian/hello-stimulus-bundle. 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 hello-stimulus-bundle

HelloStimulusBundle

This Bundle provides Twig and Symfony form helper functions for Stimulus.js.

Overview

  1. Features
  2. Installation
  3. Twig helper functions
  4. Form helper functions

Features

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download this bundle:

Step 2: Enable the Bundle (without flex)

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

Twig helper functions

hello_stimulus_controller(controllerName, values = [])

Render value controller attribute. Optional with values.

Parameters

controllerName: name of the controller

values: array of stimulus values (optional)

Examples

is rendered to

You can use two ways to specify the controller:

Assuming the controller is located at assets/controllers/user/user_form_controller.js

Both variants give the same result.

hello_stimulus_target(controllerName, target)

Render value target attribute.

Parameters

controllerName: name of controller for this target

target: name of the target attribute

Examples

is rendered to

hello_stimulus_action(controllerName, event, method)

Render action data attribute.

Parameters

controllerName: name of controller for this action

event: DOM event to listen for

method: name of the JavaScript method inside the controller class

Examples

is rendered to

hello_stimulus_value(controllerName, name, value)

Render value data attribute.

Parameters

controllerName: name of controller for this value

name: name of this value

value: value of this value

Examples

is rendered to

Form helper functions

In Symfony Forms it is helpful to pass attributes of stimulus directly to the types. For this purpose, this bundle provides a helper class with two methods (target() and value()).

Full example of StimulusFormHelper

StimulusFormHelper API

__construct(controllerName, defaultEvent = "click")

Paramters

controllerName: name (and location) of the JavaScript controller class

defaultEvent: (optional): default DOM event to listen for (default is the "click" event)

Usage

You can use two ways to specify the controller:

Assuming the controller is located at assets/controllers/user/user_form_controller.js

Both variants give the same result.

target(target)

Parameters

target: name of target property inside stimulus controller

Returns
Usage

action(method, event = null)

Parameters

method: name of JavaScript method inside stimulus controller

event: (optional) DOM event to listen for (if null, default event from constructor is taken)

Returns
Usage

Example

action and traget return an array. If you want to use both inside the same attr, you can use array_merge().


All versions of hello-stimulus-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
sensio/framework-extra-bundle Version ^5.1
symfony/twig-bundle Version ^4.4|^5.0
symfony/form Version ^4.4|^5.0
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 hello-sebastian/hello-stimulus-bundle contains the following files

Loading the files please wait ....