title: Assign pagination from function
body: <p>Can someone please tell me how I can return pagination results to a template through a function instead of assigning it directly to a template.</p>
  
  <p>I can get the data returned ok using</p>
  
  <pre><code>$return_vars['$results'] =  array_slice($results, SmartyPaginate::getCurrentIndex(),SmartyPaginate::getLimit());
  </code></pre>
  
  <p>But i cant seem to get the other information like</p>
  
  <pre><code>{* display pagination header *}
      Items {$paginate.first}-{$paginate.last} out of {$paginate.total} displayed.
  {* display pagination info *}
      {paginate_prev} {paginate_middle} {paginate_next} 
  </code></pre>
  
  <p>I think basically instead of </p>
  
  <pre><code>// assign {$paginate} var
  SmartyPaginate::assign($smarty);
  // display results
  $smarty-&gt;display('index.tpl');
  </code></pre>
  
  <p>I need something like </p>
  
  <pre><code>$return_vars['pagination'] = SmartyPaginate::assign($smarty);
  </code></pre>
  
  <p>but the array returned is empty</p>