Welcome Guest, Not a member yet? Register   Sign In
[ask]pigination in include page
#1

[eluser]Unknown[/eluser]
dear all i have case with pagination
i cannot browse page if i using pagination in includepage

this my source please healp me
my contoller

Code:
<?php

class Welcome extends Controller {
    
    function Welcome()
    {
        parent::Controller();
                $this->load->model('post_mod','',TRUE);
                $this->load->library('pagination');
                $this->load->library('table');
    }
    
    function index()
    {
                [b]$config['base_url'] = base_url().'index.php/welcome/';[/b]<---what should i do for this
                $config['total_rows'] = $this->post_mod->count('post');
                $config['per_page'] = 5;
                $this->pagination->initialize($config);
                $this->data['results'] = $this->post_mod->get('post','post_id,cat_id,post_title,post_content,post_date,user_id','',$config['per_page'],$this->uri->segment(4));
                $this->data['mainpos'] = 'public_home';
        $this->load->view('home',$this->data);
    }

my view in home
Code:
<div class="section">

                <div class="section-title">Blog</div
                                <div class="section-content">

                    [b]&lt;?$this->load->view($mainpos);?&gt;[/b]<---this include for public_home
                                        
                    <div class="content-separator"></div>
                    <div class="col3 left">
                        <div class="column-content">


my view in public_home
Code:
&lt;?
if(count($results)){?&gt;

&lt;?foreach($results as $key => $list){?&gt;
<div class="post">
    <div class="post-title"><h2>&lt;?php echo $list['post_title'];?&gt;</h2></div>
    <div class="post-date"><span class="post_date">&lt;?php echo $list['post_date'];?&gt;</span></div>
    <div class="post-body">
    <p>&lt;?=auto_typography(word_limiter($list['post_content']),80 );?&gt;</p>
        <hr>

        </div>

</div>

&lt;?}?&gt;
            &lt;?}?&gt;
&lt;?php echo $this->pagination->create_links();?&gt;

that database can i see but i limit page to 5 page and get page like this 1 2 3 4 > and i want to see page 2 the page is missing i cant declare
Code:
$config['base_url'] = base_url().'index.php/welcome/';
in include file please explain to me what should i do for this case
sory my english is poor Big Grin btw thx before
#2

[eluser]toopay[/eluser]
It seems your problems is related with removing index.php from your url. Fix that first, then we can deal the rest later.




Theme © iAndrew 2016 - Forum software by © MyBB