Paging in Codeigniter with error Type: Error Message: Unsupported operand types

0

I have a function that takes all the values from the database and sends them to a view , so I'm doing a pagination. Only when I put the

 $this->pagination->create_links()

of variable array it gives an error:

Where the error is:

Type: Error

Message: Unsupported operand types

Filename: /var/www/html/idbl/system/libraries/Pagination.php

When I shoot the

$this->pagination->create_links()

It works again.

I'm going to spend my full function here:

public function artigo_all() {
    $this->load->library('pagination');
    $config['base_url'] = base_url('site/artigo_all');
    $config['total_rows'] = $this->artigo->GetAll(false, "artigo_id", 'asc');
    $config['per_page'] = 3;
    $qnt = $config['per_page'];
    ($this->uri->segment(3) != "") ? $inicio = $this->uri->segment(3) : $inicio = 0;
    $this->pagination->initialize($config);

    $dados = array(
        'titulo' => 'Todos os artigos',
        'artigo' => $this->artigo->GetAll(false, "artigo_id", 'asc', $qnt, $inicio),
        'jeans' => $this->jeans->GetAll(false, 'jeans_id', 'asc'),
        'aniverMes' => $this->aniver->aniversarianteMes(),
        'aniverDes' => $this->aniver->aniversarianteMes(),
        'paginacao' => $this->pagination->create_links(),
    );

    $this->template->load('front/tema_front', 'front/todos_artigos', $dados);
}

What can it be?

    
asked by anonymous 16.10.2016 / 06:01

1 answer

1

Most likely your problem is when you set the value of the variable: $config['total_rows'] , that is, in your controller, check the method and or return (value) of the method, which is assigning value to variable:

  

$ config ['total_rows'] = 200; // integer value

    
31.01.2018 / 18:42