https://github.com/plesk/yii2-pjax
Plesk extension for Yii2 framework to extend it's PJAX functions
https://github.com/plesk/yii2-pjax
Last synced: 5 months ago
JSON representation
Plesk extension for Yii2 framework to extend it's PJAX functions
- Host: GitHub
- URL: https://github.com/plesk/yii2-pjax
- Owner: plesk
- License: apache-2.0
- Created: 2020-04-22T06:16:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-22T06:46:42.000Z (about 6 years ago)
- Last Synced: 2025-03-17T23:09:50.538Z (over 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 1
- Watchers: 23
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Plesk extension for Yii2 framework to extend it's PJAX functions
============================
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
- Add the following lines to your `composer.json` file:
```js
"repositories": [
{
"type": "vcs",
"url": "git@github.com:plesk/yii2-pjax.git"
}
]
```
- Run `composer require "plesk/yii2-pjax:^1.0.0"`
API
------------
Setup the component in your web.php config:
```php
[
'components' => [
'pjax' => [
'class' => 'plesk\yii2pjax\Component',
],
],
]
```
Convert PJAX config from Yii2 widget format to JS format.
```php
$this->registerJs(
'$("#plesk-pjax-search-form").on("pjax:success", function() {
$.pjax.reload(' . Json::encode(Yii::$app->pjax->pjaxConvertConfigWidgetToJs($gridPjaxOptions)) . ');
});'
);
```
Exceptions
- plesk\yii2pjax\exceptions\Exception
All exceptions thrown by the extension, extend this exception.