Action Buttons

Hi to all again!

Please excuse my english.

Im having some troubles with buttons on actionColums

I need to open (or redirect to) asignation.php file when i pick on "info" button.

But, I cant figure it out, and i cant find a full example to follow.

Can some one give me a hand?

I leave the hicherachy on the pick :9

Thanks in advance!

Like this?


            [

            	'class' => 'yii\grid\ActionColumn',

				'template' => '{info} {view} {update} {delete}',

				'buttons' => [

				    'info' => function ($url, $model, $key) {

				        return Html::a('<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>', ['asignation']);

				    },

				],

            ],

Of course you have to edit the url ;)

Thanks!

What about modify $url?

What is this variable? What it content?

Sorry but im very noob on this.

$url contains the url… with the name of the button and id of record…

In this case, when you use


                                    'info' => function ($url, $model, $key) {

                                        return Html::a('<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>', $url);

                                    },

This would be the url:

http://<your domain>/<controller>/info?id=1 (For the first record with id 1)

What is your purpose of the info button

Do you want to redirect to an external site? or do you want to redirect to an action of the same controller…