Download the PHP package seblhaire/tagsinput without Composer

On this page you can find all versions of the php package seblhaire/tagsinput. 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 tagsinput

Tagsinput

By Sébastien L'haire

A Laravel library with jQuery add-on to add tags (Boostrap badges) selected by an auto-completer.

It uses:

Demo site available here.

Installation

  1. composer require seblhaire/tagsinput
  2. Composer will automatically link the package with Laravel. But you still can explicitely add provider and facade to your config/app.php:

  3. Publish package (optionally).

  4. For Javascript and stylesheets, see next section.

Javascript ans stylesheets

On a webpage, every JS library and CSS stylesheets can be linked separately. If you choose this classical way, first dowload and install above mentioned libraries. Then publish package files as explained above and put following tags in your template:

But websites often use many libraries and stylesheets and browser must download many files before the site can be rendered properly. Modern websites come with a single compressed Javascript file which concatenates necessary scripts; same principle for stylesheets. With Laravel you can use Laravel Mix to compile files.

Use NPM package manager : npm install bootstrap jquery

Then your js source file should be something like this:

For your stylesheet:

Configuration file

Tagsinput library is customizable. Default values can be changed, either in configuration file, or by passing options in Facade function (see next section). If you want to modify default configuration file, publish package files and access to config/autocompleter.php and config/tagsinput.php.

Usage

Tagsinput package comes with a simple Facade.

TagsinputHelper::init

Inits a tagsinput object and an autocompleter object that can be passed to the view.

TagsinputHelper::init($divid, $label, $url, $optionsAc, $optionsTags) where:

To summarize in your controller insert:

In your blade template, insert following at the place you want the tags list to appear:

{!! $tagszone !!} or {!! $tagszone->output() !!}

Output methods

output()

This method output() prints tags and outputs tagsinput and autocompleter initialization script. It uses the above methods that you can also use to organize your code as you wish.

printLabel()

This method prints the label <div>.

printAutocompleter()

This method prints the autocompleter zone.

printTagList()

This method prints the tag list zone.

printHelpText()

This method prnts help text zone.

printAcCallback()

Prints autocompleter callback to add a new tag to list.

printTagInputInit()

Prints initialization of autocompleter and tagsinput objects. Better insert it in jQuery(document).ready clause.

printHiddenInput()

Prints hidden input to contain tagsinput comma-separated output.

Following methods can be used to manage tags list and to send tags list to other scripts with different formats.

printReset()

Empties tags list.

printCount()

Returns current tags list size.

printGetArrayValues()

Returns an array of tags list values. Eg: ["CH","FR"]

printGetCommaSepValues()

Returns a string with tags list values separated by comma. Eg.: CH,FR. This list is automatically inserted in hidden input if hiddeninput value is true.

printSerialize($champ)

Returns serialized values that can be used in a Javascript string to send values to a controller. In a blade template write for example:

will output something like: let params = jQuery('#tagzone_taglist').data('tagsinput').serialize('country'); and content of variable params will be: country[]=CH&country[]=FR

printAddToList($varia)

This method can be used to pre-add values to the tag list at page initialization or after loading data by an Ajax script. $varia can be a simple Json object or an array of objects. {code:'CH', taglabel:'CH: Switzerland'} is an object that contains 2 fields: code labels the label value, the unique identifiers that will be return in tags list. This is the value of option field, Cf. above. tagnsinput is the label that will be displayed in tag, corresponding to option taglabelelement. Array of object is a comma-separated string of objects in square brackets []. Cf example below. Insert in blade template:

This will output this string in code: jQuery('#tagzone_taglist').data('tagsinput').addtolist([{code:'CH', taglabel:'CH: Switzerland'},{code:'FR', taglabel:'FR: France'}]); Of course you can retrieve dynamic values from a database and pre-fill a form in order to edit database entries.

Translation keys

Laravel loads config files very early in process. Therefore config files cannot contain __('translation.key'). In order to solve this issue, we made an helper either to print directly strings or to send translation key to translation helper. Translation keys can be delimited by character # . Ex: "#tagsinput::messages.tagshelp#". Original translations are stored under vendor/seblhaire/tagsinput/resources/lang. If you publish package files, you can find translations in resources/lang/vendor/tagsinput/.

Feel free to translate keys in your own language and either to send it to the author or to do a merge request on GitHub.

Questions? Contributions?

Feel free to send feature requests or merge request to the author or simply to ask questions.


All versions of tagsinput with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/http Version ^11.0
seblhaire/autocompleter Version ^1.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 seblhaire/tagsinput contains the following files

Loading the files please wait ....