How to render partial view on navBar menuItem click?


I want to render a partial view in my index.php when on NavBar MenuItem is clicked

How should I do that?

Thanks in advance

here is my code

I want to add an event instead of a url…

if (!Yii::$app->user->can('employee')) {

        $menuItems[] = ['label' => Yii::t('app', 'School'), 'url' => ['/school/index']];

        $menuItems[] = ['label' => Yii::t('app', 'Administration'), 'url' => ['/site/contact']];


use jquery to to load contents into a div here is an example change your selectors and urls accordingly

$('a[href="/site/contact"]').click(function() {

    $( "#div-id-to-render-in" ).load( "url/to/action" );