title: Yii2, optional parameter in the rounte
body: <p>During the development, I have faced to the one issue with urlManager.</p>
  
  <p>I have SiteController with "category" action.</p>
  
  <pre><code>public function actionCategory($id = null, $city = null, $location = null)
  {
     echo $id;
     echo $city;
     echo $location;
  }
  </code></pre>
  
  <p>All possible combination that can be used with this action:</p>
  
  <pre><code>id, city, location = null
  id, city = null, location
  id, city = null, location = null
  id = null, city = null, location = null
  id = null, city = null, location
  </code></pre>
  
  <p>I do not know how to write the rules in the UrlManager, after that I will get the following values in the variables after press the links:</p>
  
  <pre><code>&lt;h4&gt;&lt;?= Html::a('ID City', ['/site/category', 'id' =&gt; 'barbershop', 'city' =&gt; 'Praha'], ['class' =&gt; 'btn btn-primary']) ?&gt;&lt;/h4&gt;
  The return value from "category" action:
  
  id = 'barbershop'
  city = 'Praha'
  location = ''
  
  &lt;h4&gt;&lt;?= Html::a('ID Location', ['/site/category', 'id' =&gt; 'barbershop', 'location' =&gt; '23,65'], ['class' =&gt; 'btn btn-primary']) ?&gt;&lt;/h4&gt;
  The return value from "category" action:
  
  id = 'barbershop'
  city = ''
  location = '23,65'
  
  &lt;h4&gt;&lt;?= Html::a('ID', ['/site/category', 'id' =&gt; 'barbershop'], ['class' =&gt; 'btn btn-primary']) ?&gt;&lt;/h4&gt;
  The return value from "category" action:
  
  id = 'barbershop'
  city = ''
  location = ''
  
  &lt;h4&gt;&lt;?= Html::a('City', ['/site/category', 'city' =&gt; 'Praha'], ['class' =&gt; 'btn btn-primary']) ?&gt;&lt;/h4&gt;
  The return value from "category" action:
  
  id = ''
  city = 'Praha'
  location = ''
  
  &lt;h4&gt;&lt;?= Html::a('Location', ['/site/category', 'location' =&gt; '14,23'], ['class' =&gt; 'btn btn-primary']) ?&gt;&lt;/h4&gt;
  The return value from "category" action:
  
  id = ''
  city = ''
  location = '14,23'
  </code></pre>
  
  <p>Would you like you help me with this issue?</p>