2

I'm working on a module that uses soap to fetch data from a webservices. Data are ok, and I'll use theme functions to display them as a list. I should also to split results in pages, like views. Is there a way to add a pager?

1 Answer 1

1

Use something like


 foreach ($result as $node) 
{
    $rows[] = array('data' => array("".  $node  ."...

"));
$html = theme('table',array('header' => $header,'rows'=>$rows,'caption' => '','sticky' => FALSE,'empty' => 'No details found...','attributes'=>array('class'=>'table-class'),)); $html.= theme('pager',array('tags' => array(),'quantity'=> 10)); }

2
  • I try it, but the pager is not created, I've only html from the table
    – arrubiu
    Commented Jul 9, 2012 at 9:14
  • Ok, I've to initialize the pager and it works.
    – arrubiu
    Commented Jul 9, 2012 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.