title: How to pass multiple arguments to a smarty function?
body: <p>I've a following code snippet from smarty template:</p>
  
  <pre><code>&lt;div class="pagination"&gt;
    {pagination_link_01 values=$pagination_links}
  &lt;/div&gt;
  </code></pre>
  
  <p>The following is the function body:</p>
  
  <pre><code>&lt;?php
  
  function smarty_function_pagination_link_01($params, &amp;$smarty)
  {
  
      if ( !is_array($params['values']) )
      {
        return "is not array";
      }
      if ( 0 == count($params['values']) )
      {
        return "Empty Array";
      }
      if ( empty($params['values']['current_page']) )
      {
        return "Invalid Request";
      }
  
      $values = $params['values'];
  
      //Seperator Used Betwinn Pagination Links
      $seprator = empty( $params['seperator'] ) ? "&amp;nbsp;&amp;nbsp;" : $params['seperator'];
  
      //Class Name For Links
      $extra = empty( $params['extra'] ) ? "" : $params['extra'];
  
      $current_page  = (int)$values['current_page'];
  
      if ( !empty($values['first']) )
      {
          //$ret[] = "&lt;a $extra href='{$values['first']}' &gt;&amp;lt;First&lt;/a&gt;";
      }
      if ( !empty($values['previous'] ) )
      {
          $ret[] = "&lt;a $extra href='{$values['previous']}' class='prev active'&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;";                
      }
      $ret[] = "&lt;ul&gt;";
      foreach( $values as $k =&gt; $v )
      {
            if( is_numeric( $k ) )
            {
                  if ( $k == $current_page)
                  {
                      $ret[] = "&lt;li&gt;&lt;a $extra class='active'&gt;$k&lt;/a&gt;&lt;/li&gt;";
                  }
                  else
                  {
  
                      $ret[] = "&lt;li&gt;&lt;a $extra href='$v'&gt;$k &lt;/a&gt;&lt;/li&gt;";
  
                  }
            }
      }
  
      if ( !empty($values['next'] ) )
      {
          $ret[] = "&lt;/ul&gt;&lt;a $extra href='{$values['next']}' class='next active'&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;";
  
      }
  
      if ( !empty($values['last'] ) )
      {
          //$ret[] = "&lt;a $extra href='{$values['last']}' &gt;Last&amp;gt;&lt;/a&gt;";
      }
  
      //$str_ret = $first . $previous . $str_ret . $next . $last;
      if ( $ret )
      {
          return implode( $seprator, $ret );
      }
  }
  ?&gt;
  </code></pre>
  
  <p>If I print <code>$params</code> I'm getting the values I passed by means of an array <code>$pagination_links</code>. Similarly I want to add one more argument named <code>$total_pages</code> to the above function call and use it in the function body. I tried many ways but it couldn't happen. Can anyone please guide me in this regard please. Thanks in advance.</p>