render page without refresh


Please let me know how to render or access page with refresh in yii2?

I am aware of ‘yii\widgets\Pjax’ but it is only to render some portion of the page.

I want to load/access whole page by clicking on menus on header without refresh.

You can also apply Pjax to entire page. Have you tried?

It is not working. Page is getting refresh and loads again.

Also it keeps adding controller name in URL ‘http : // localhost/gap/trunk/frontend/web/site/site/site/site/contactus’

Have you tried to setting ‘timeout’ property to a big number? Because if the page take much time to load from ajax, it will be called a full reload of url.

I remember that you can set ‘timeout’ to false to disable the full refresh when ajax call is slow.$timeout-detail

I have set timeout now <?php Pjax::begin([‘timeout’=> 100000]); ?>

I have added Pjax::begin and Pjax::end in main.php but still whole page gets refreshed and in URL controller’s name gets added id click on contact us in header(Nav Bar)


Checking browser console, do you see the ajax call?


I have found other way round,

I have return jQuery Function for this in header I have written this Jquery function call