Pull down menu with current month

Does anyone have any pointers as to how I could add a pull down menu to the main navbar, that displays the current month, and maybe the last 2 or 3 months.

Eg

Menu

|

March (Current)

|

February

|

January

And then, how can I use that click request in the Controllers actionView() as a parameter ?

Thx

You can use DropDownButton to make the "pull down menu" : http://www.yiiframework.com/doc-2.0/yii-bootstrap-buttondropdown.html

Example :




...

 yii\bootstrap\ButtonDropdown::widget([

    'label' => 'Months',

    'dropdown' => [

        'items' => [

            ['label' => 'March', 'url' => ['/site/view', 'month' => 'march']],

            ['label' => 'February', 'url' => ['/site/view', 'month' => 'february']],

            ['label' => 'January', 'url' => ['/site/view', 'month' => 'january']],

        ],

    ],

]);

...



And in your action view :




public function actionView($month)

{

 ...

}