CodeIgniter has nice buildin pagination system. Please read User Guide. There you get simple example and details. Here you can find the ajax pagination example of ajax_jquery library. Though it integrates ajax using jquery but the basic idea of using pagination is similar.
Anyway Here I found you use
$data = $this->m_search->search($cat_
Please use $data as an array variable like below
$data['result'] = $this->m_search->search($cat_
then pass the $data to your view
In the view page $result variable will available as array. Then you can iterate the result as follows
foreach($result as $row)
{
//Your code
}
Another thing is I guess you try to use smarty templating engine with CodeIgniter. I suggest it will be bulky for your application.
Regards
Abser
I hope this comes helpful.
http://tohin.
Mohammad Amzad Hossain
www.jhoroTEK.
Blog: tohin.wordpress.
--- In phpexperts@yahoogro
>
> another link...
> http://codeigniter.
>
> --- In phpexperts@yahoogro
> >
> > Hi,
> >
> > I need pagination code for codeigniter.
> >
> > My MODEL code Is
> >
> > function search($cat_
> > {
> > $sql = "SELECT * FROM Cat_details WHERE cat_id='".$cat_id ."' LIMIT $offset, 5";
> > //some code
> > retrun result;
> > }
> >
> > My CONTROLLER code Is.
> >
> > function search()
> > {
> > $rarr = $this->uri->segment_array(
> > $cat_id = $rarr[3];
> > $data = array();
> > $offset = 0;
> >
> > $data = $this->m_search->search($cat_
> >
> > $this->my_smarty->my_display('search/search_
> > }
> >
> > help me please, i have seen user guide already.
> >
> >
> > Best wishes
> > =======
> > Shaon
> > ============
> > = Web developer, Future Group =
> > ============
> >
>
--
Nurul Abser
abser-bd.blogspot.
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
No comments:
Post a Comment