Tutorial by Examples

In views\site\form-submission.php <?php Pjax::begin(['id'=>'id-pjax']); ?> <?= Html::beginForm(['site/form-submission'], 'post', ['data-pjax' => '', 'class' => 'form-inline']); ?> <?= Html::input('text', 'string', Yii::$app->request->post('string'), ['class' =&gt...
public function actionFormSubmission() { $security = new Security(); $string = Yii::$app->request->post('string'); $stringHash = ''; if (!is_null($string)) { $stringHash = $security->generatePasswordHash($string); } return $this->render('form-submi...
Add this line at the beginning of your view. <?php use yii\widgets\Pjax; ?> Add the following two lines around the content that needs partial updating. <?php Pjax::begin(['id'=>'id-pjax']); ?> Content that needs to be updated <?php Pjax::end(); ?> reload pjax $.pjax...
Yii Framework 2.0 ships with built-in support for Pjax, a JavaScript library that reduces page load times. It accomplishes this by only updating the part of the page that has changed through Ajax, which can translate into substantial savings if you have many other assets on your pages. A few of our ...

Page 1 of 1