Welcome Guest, Not a member yet? Register   Sign In
Building next/prev links
#7

[eluser]Sarfaraz Momin[/eluser]
Well I am not calling it from the view. I have my own template system where once the prev/ next links are generated it just replaces the tags {prevnext} for me with the relevant links. What you can do is

controller
Code:
$prevdata = $this->MyModel->get_prevnext_content($pull_content[0]->subcategory_id,$pull_content[0]->content_id,'prev');
        $nextdata = $this->MyModel->get_prevnext_content($pull_content[0]->subcategory_id,$pull_content[0]->content_id,'next');
        $data['prevlink'] = "<div style=\"float:left;width:380px;padding-left:10px\" align=\"left\"></div>";
        $data['nextlink'] = "<div style=\"float:left;width:380px;padding-left:10px\" align=\"left\"></div>";
        if($prevdata){
            $data['prevlink'] = "<div style=\"float:left;width:380px;padding-left:10px\" align=\"left\"><a title=\"".$prevdata[0]->content_name."\" href=\"".str_replace(" ","-",strtolower($prevdata[0]->content_name)).".html\" class=\"prevnext\">Previous Ecard</a></div>";
        }
        if($nextdata){
            $data['nextlink'] = "<div style=\"float:left;width:380px;padding-right:10px\" align=\"right\"><a title=\"".$nextdata[0]->content_name."\" href=\"".str_replace(" ","-",strtolower($nextdata[0]->content_name)).".html\" class=\"prevnext\">Next Ecard</a></div>";
        }
$this->load->view('viewpage', $data);

viewpage.php
Code:
&lt;?= $prevlink; ?&gt;
&lt;?= $nextlink; ?&gt;

I hope it makes sense.

Good Day !!!


Messages In This Thread
Building next/prev links - by El Forum - 12-24-2007, 04:40 AM
Building next/prev links - by El Forum - 12-24-2007, 05:08 AM
Building next/prev links - by El Forum - 12-24-2007, 05:26 AM
Building next/prev links - by El Forum - 12-24-2007, 05:34 AM
Building next/prev links - by El Forum - 12-27-2007, 02:22 AM
Building next/prev links - by El Forum - 12-28-2007, 11:09 PM
Building next/prev links - by El Forum - 12-29-2007, 12:12 AM
Building next/prev links - by El Forum - 12-29-2007, 03:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB