PHPackages                             smallbearsoft/yii2-ajax - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. smallbearsoft/yii2-ajax

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

smallbearsoft/yii2-ajax
=======================

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

1.0.2(10y ago)116.1k↓54.4%[1 issues](https://github.com/smallbearsoft/yii2-ajax/issues)MITPHPPHP &gt;=5.4.0

Since Sep 6Pushed 10y ago1 watchersCompare

[ Source](https://github.com/smallbearsoft/yii2-ajax)[ Packagist](https://packagist.org/packages/smallbearsoft/yii2-ajax)[ RSS](/packages/smallbearsoft-yii2-ajax/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

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
-----------------------

[](#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

```
