If you’re using Yii2 Gridview with tabs and notice that when the user filters the results, posting the page goes to the wrong tab. This solution worked great for me: $(document).ready(function() { $(‘a[data-toggle=\”tab\”]’).on(‘show.bs.tab’, function (e) { localStorage.setItem(‘lastTab’, $(this).attr(‘href’)); }); var lastTab = localStorage.getItem(‘lastTab’); if (lastTab) { $(‘[href=\”‘ + lastTab + ‘\”]’).tab(‘show’); } }); via Maintain […]
Monthly Archives: January 2018
How to know which Yii version you’re using?
It’s simple to learn what version you’re using. Just place this code in any controller action or at the top of in app/web/index.php: echo Yii::getVersion(); exit;