title: yii2 : how to pass data on link click from one page to another
body: <p>In yii2 I am trying to pass data on link click from one page to another. And for this I am using POST as following:-</p>
  
  <pre><code>Html::a('link-name', ['/url/place-details?id='.$place_id], [
    'data'=&gt;[
           'method' =&gt; 'post',
           'params'=&gt;['place'=&gt;json_encode($place)],
      ]]) 
  </code></pre>
  
  <p>This is working fine when I click the link first time, the post request contains all the required data. But if I refresh the page (or go to another page and then click back from browser) this post data is lost. And following error message is displayed:-</p>
  
  <blockquote>
    <p>PHP Notice – yii\base\ErrorException Undefined index: place</p>
  </blockquote>
  
  <p>As the request now doesn't contain the posted data. How can I resolve this and create a request that perserve data along the sessions. I have tried passing data through sessions but same issue persists.</p>
  
  <p>Following is the controller action that handles the requested URL:-</p>
  
  <pre><code>public function actionPlaceDetails($id=null)
  {
      $request = Yii::$app-&gt;request;
      $data = $request-&gt;post('place');
      $place = json_decode($data);
      return $this-&gt;render('place',['place'=&gt;$place]);
  }
  </code></pre>