2017 © Pedro Peláez
 

yii2-extension yii2-ajaxq

Customizable ajaxq widget for Yii2

image

loveorigami/yii2-ajaxq

Customizable ajaxq widget for Yii2

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Ajaxq Widget for Yii2

A customizable AjaxQ jQuery plugin for Yii2 based on Ajaxq., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require "loveorigami/yii2-ajaxq" "*"

or add, (*4)

"loveorigami/yii2-ajaxq" : "*"

to the require section of your application's composer.json file., (*5)

Usage

  • In view:
use lo\widgets\Ajaxq;

<?php
 echo Ajaxq::widget([
      'url' => '/site/demo',
      // 'success' =>'$(".res").html(res)',
      // 'tpl' => 'from_to' // default view for generating ajax requests
  ]);

  • In controller:
    /**
     * Controller name - Site
     * Demo for ajaxq request
     * @return json
     */
    public function actionDemo()
    {
        $post = \Yii::$app->request->post('dataq'); // get associative array dataq

        \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

        $data['id'] = $post['id'];
        $data['mes'] = $post['id'].' - It is ok!';

        $res = print_r($data, true);

        echo json_encode($res);
    }

The Versions

02/07 2015

dev-master

9999999-dev

Customizable ajaxq widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget ajaxq

02/07 2015

1.0

1.0.0.0

Customizable ajaxq widget for Yii2

  Sources   Download

MIT

The Requires

 

yii2 ajax widget ajaxq