Download the PHP package smallbearsoft/yii2-ajax without Composer

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

yii2-ajax

This is a ajax widget of yii2 which will generate a div. The tags (except form) click or forms submission (for those tags and forms with data-ajax attribute) in this div will trigger an ajax request.

Simple example for link

We can get some data by ajax link useing Ajax widget. First, we should have a controller and an action to render our view. Of course, we can just use SiteController as our controller. Then we write an action in SiteController named actionLink to render link.php. In addition, add actionResponse action to response ajax request through ajax link:

SiteController.php

link.php

Simple example for form

If you want to use ajax to post a form to server, you can use this Ajax widget make it essay. We will still use SiteController as our controller. Then we add two actions actionForm and actionPost. To make it simple, we will not use ActiveForm widget, but you can use that in your code:

SiteController.php

form.php

Actually you can also use Ajax widget to upload files, just add an input like <input type="file" name="image"/>. You will see your file in $_FILES variable on server.

More tutorials

See Home wiki for more tutorials.

Tips

To trigger the Ajax widget, you can use a submit button or a jquery submit() function. But cannot use the pure javascript submit() function to trigger it. You can use:

Cannot use:

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.


All versions of yii2-ajax with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yiisoft/yii2 Version *
bower-asset/jquery Version >=1.9.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 smallbearsoft/yii2-ajax contains the following files

Loading the files please wait ...