title: Yii2 - Pass variable from view to Gridview custom action columns
body: <p>I want to save the last place that a user visited before he click onto "Edit" button in the gridview widget of a page. I created a variable named $lastAddress but I really dont know how to pass it onto the gridview and append it to the $url variable of "Edit" button. Can anyone show me how?</p>
  
  <pre><code>$lastAddress = 'xxx';
      &lt;?=
          GridView::widget([
              ...
                  [
                      'class' =&gt; 'yii\grid\ActionColumn',
                      'template' =&gt; '{view} {update} {delete}',
                      'buttons' =&gt; [
                          'update' =&gt; function ($url, $model) {
                              $url .= '&amp;lastAddress=' . $lastAddress; //This is where I want to append the $lastAddress variable.
                              return Html::a('&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;', $url);
                          },
                      ],
                  ],
              ],
          ]);
          ?&gt;
  </code></pre>