Download the PHP package abolotin/yii2-unique-id without Composer

On this page you can find all versions of the php package abolotin/yii2-unique-id. 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 yii2-unique-id

Unique widget's IDs generator

Generating unique identificator for any purposes. Typically used by Yii-widgets ("id"-attribute of HTML elements).

Standard Yii2 generator use prefix "w" and simple counter of generated IDs. It's enougth while non-AJAX requests used. But if you're want to load some page content via AJAX-request, you're can obtain HTML-elements with same IDs ("w1", for example). So, some scripts, based on element's ID, will work unexpectedly. Such behaviour may be bypassed by specifying ID manually in code. Another way is setting up Widget::$autoIdPrefix.

Installation

Using Composer

You can use the composer package manager to install. Either run:

$ php composer.phar require abolotin/yii2-unique-id

or add:

"abolotin/yii2-unique-id": ""

to your composer.json file

Manual Install

You can also manually install the component easily to your project. Just download the source ZIP or TAR ball

Usage

Using in manual mode

Just call \abolotin\yii2\UniqueId::getId(). It's returns unique value, which can be assigned to "id" attribute of HTML-element.

Using in automatic mode

You're can to setup automatic generation of IDs by any \yii\base\Widget based objects. Just add '\abolotin\yii2\UniqueId' string to 'bootstrap' array of applications configuraion:

or using component's mode:

In last case it's can be also configured.

Configuration

Component allows next configuration options:

widgetPrefix - string. First prefix, used by widget generator. Default value: 'w'.

pjaxPrefix - string. First prefix, used by Pjax widget generator. Default value: 'p'.

autoIdPrefix - string. Second prefix, used by generator. If unspecified, will be generated automatically.

counter - integer. Inner generated IDs counter. Default value: 0.

suffix - string. Suffix of inner generated ID. Default value: 't'.


All versions of yii2-unique-id with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version >=2.0.0
php Version >=5.3.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 abolotin/yii2-unique-id contains the following files

Loading the files please wait ....