Download the PHP package sirian/suggest-bundle without Composer

On this page you can find all versions of the php package sirian/suggest-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 suggest-bundle

SuggestBundle

About

This is a Symfony bundle which enables the popular Select2 component to be used as a drop-in replacement for a standard entity, document and choice fields on a Symfony form.

The main feature of this bundle is that the list of choices is retrieved via a remote ajax call.

1. Installation

Add the sirian/suggest-bundle package to your require section in the composer.json file.

Add the SuggestBundle to your application's kernel:

2. Configuration

After installing the bundle, make sure you add this route to your routing:

And choose default widget for form (depends on select2 version you use). One of select2_v3, select2_v4. You could also specify other default form options for SuggestType::class

3. Configuring suggesters

3.1. Doctrine ODM Document suggesters

3.2. Doctrine ORM Entity suggesters

3.3. Custom suggesters

When you need some additional logic - you could create your own suggester. For example let's create AdminSuggester which suggests only users having ROLE_ADMIN role

Define service services.yml with sirian_suggest.suggester tag

Alias admin will be used in suggester option for SuggestType::class and in /suggest/admin url pattern.

4. Using

Now you can use configured suggesters in forms

5. Security

You could restrict access to suggesters by securing URL patterns

6. Passing additional options to suggester

Sometimes you need to pass additional parameters to Suggester.

6.1. Static extra options

Let's start with simple example. You have brands and models and you want to display only models for one specific brand. Create class ModelSuggester

Define service

and add extra option to form options:

6.2. Dynamic extra options

Now let's see an example when you have 2 suggest fields brand and model and in second select you want to display models for selected brand.

You need to create ModelSuggester and define suggester service (like in previous section).

And then customize form widget to pass brand_id extra option to suggester


All versions of suggest-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3||^8.0
symfony/framework-bundle Version ^5.0
symfony/form Version ^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 sirian/suggest-bundle contains the following files

Loading the files please wait ....