Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
ff521fd7
Commit
ff521fd7
authored
Jan 30, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated pjax doc.
parent
07c7236b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
Pjax.php
framework/widgets/Pjax.php
+10
-12
No files found.
framework/widgets/Pjax.php
View file @
ff521fd7
...
...
@@ -16,10 +16,17 @@ use yii\web\Response;
/**
* Pjax is a widget integrating the [pjax](https://github.com/defunkt/jquery-pjax) jQuery plugin.
*
* Pjax captures the link clicks in the content enclosed between its [[begin()]] and [[end()]] calls,
* turns them into AJAX requests, and replaces the enclosed content with the corresponding AJAX response.
* Pjax only deals with the content enclosed between its [[begin()]] and [[end()]] calls, called the *body content* of the widget.
* By default, any link click or form submission (for those forms with `data-pjax` attribute) within the body content
* will trigger an AJAX request. In responding to the AJAX request, Pjax will send the updated body content (based
* on the AJAX request) to the client which will replace the old content with the new one. The browser's URL will then
* be updated using pushState. The whole process requires no reloading of the layout or resources (js, css).
*
* The following example makes the [[\yii\gridview\GridView]] widget support updating via AJAX:
* You may configure [[linkSelector]] to specify which links should trigger pjax, and configure [[formSelector]]
* to specify which form submission may trigger pjax.
*
* The following example shows how to use Pjax with the [[\yii\gridview\GridView]] widget so that the grid pagination,
* sorting and filtering can be done via pjax:
*
* ```php
* use yii\widgets\Pjax;
...
...
@@ -29,15 +36,6 @@ use yii\web\Response;
* Pjax::end();
* ```
*
* Clicking the sorting and pagination links in the grid will trigger AJAX-based updating of the grid content.
* Moreover, if the grid view has turned on filtering, the filtering will also be performed via AJAX.
*
* By default, Pjax enables [[enablePushState|push state]], which means the browser's current URL will
* be updated when an AJAX request is made by Pjax.
*
* Pjax can also be used for submitting forms, check the
* [pjax documentation](https://github.com/defunkt/jquery-pjax#pjaxsubmit) for it.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment