Welcome Guest, Not a member yet? Register   Sign In
Manual pagination problem in CI4.
#2

I solved my problem but I don't know if it will be the correct way.

I have my system configured with the following path

PHP Code:
App.php
public $ baseURL 'http://localhost/test'


The $pager->setPat() function; return "localhost" only

By adding $_SERVER['PHP_SELF'] I can fill in the required url.

PHP Code:
$pager->setPat($_SERVER['PHP_SELF']) 


http://localhost/test/index.php/proyecto......?page=1..........




PHP Code:
    $page $this->request->getGet 'page' ) ? $this->request->getGet 'page' )  0

    $data_db 
$this->proyecto_model->list_proyecto $data_search$limit$page );
        
    
$total_rows $this->proyecto_model->list_proyecto_all $data_search );

    
$pager = \Config\Services::pager();

    
$pager->setPath($_SERVER['PHP_SELF']);

    
$data ['pagination'] = $pager->makeLinks($page$limit$total_rows'paginador_bootstrap'); 
Reply


Messages In This Thread
Manual pagination problem in CI4. - by hugoafr - 07-10-2020, 07:32 PM
RE: Manual pagination problem in CI4. - by hugoafr - 07-13-2020, 09:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB