title: Pass params from view to layout in Yii2
body: <p>I have a variable in view file, i want pass this to layout file.</p>
  
  <p>I use params like below:</p>
  
  <pre><code>$this-&gt;params['name'] = 'masoud';
  </code></pre>
  
  <p>I try to print this in layout file:</p>
  
  <pre><code>&lt;?= $this-&gt;params['name'] ?&gt;
  </code></pre>
  
  <p>I get an error: <code>Undefined index: name</code> how cat i fix it?</p>