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?