title: how can I pass parameters to joomla component correctly?
body: <p>I want to send a parameter to a joomla component by Get method</p>
  
  <p>This is The URL:</p>
  
  <pre><code>index.php?option=com_bahaedini&amp;search=keyword&amp;view=items&amp;year=yyyy&amp;month=mm&amp;&amp;day=dd
  </code></pre>
  
  <p>ex:</p>
  
  <pre><code>index.php?option=com_bahaedini&amp;search=ebooks&amp;view=items&amp;year=2000&amp;month=1&amp;&amp;day=20
  </code></pre>
  
  <p>This is ParseRoute function:</p>
  
  <pre><code>function BahaediniParseRoute($segments)
  {
         $vars = array();
  
  
         switch($segments[0])
         {
  
                 case 'items':
                         $vars['view'] = 'items';
  
                         if(isset($segments[2]))
                         {
                         $year = explode( ':', $segments[2] );
                         $vars['year'] =  (int)$year[0];
                         }
  
                         if(isset($segments[3]))
                         {
                         $month = explode( ':', $segments[3] );
                         $vars['month'] = (int)$month[0]; 
                         }
  
                         if(isset($segments[4]))
                         {
                         $day = explode( ':', $segments[4] );
                         $vars['day'] = (int)$day[0]; 
                         }
  
                         if(isset($segments[1]))
                         {
                         $search = explode( ':', $segments[1] );
                         $vars['search'] = (int)$search[0]; 
                         }
  
                         break; 
  
  
         }
         return $vars;
  </code></pre>
  
  <p>Normally The URL changes to:</p>
  
  <pre><code>http://127.0.0.1/component/bahaedini/items/ebooks/1395/1/8
  </code></pre>
  
  <p>I print them with this method:</p>
  
  <pre><code>echo "&lt;br&gt;s:".$_ss          = urldecode($app-&gt;input-&gt;getString('search'));
  echo "&lt;br&gt;y:".$_yy          = urldecode($app-&gt;input-&gt;getString('year'));
  echo "&lt;br&gt;m:".$_mm          = urldecode($app-&gt;input-&gt;getString('month'));
  echo "&lt;br&gt;d:".$_dd          = urldecode($app-&gt;input-&gt;getString('day'));
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>ss=ebook/yy=2000/mm=1/dd=8
  </code></pre>
  
  <p>every thing is normal UNTIL:
  If I remove keyword this is the result:</p>
  
  <pre><code>ss=2000/yy=1/mm=8/dd=
  </code></pre>
  
  <p>Is there a way to solve this problem?</p>