0
I have a function that takes all the values from the database and sends them to a view, then I’m making a pagination. Only when I put the
$this->pagination->create_links()
of the variable array
he makes a mistake:
Where the mistake is this:
Type: Error
Message: Unsupported operand types
Filename: /var/www/html/idbl/system/libraries/Pagination.php
When I take the
$this->pagination->create_links()
It comes back to work.
I will pass on 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?
Natan has this line that is doing nothing:
($this->uri->segment(3) != "") ? $inicio = $this->uri->segment(3) : $inicio = 0;
I thought it would be$inicio = ($this->uri->segment(3) != "") ? $this->uri->segment(3) : 0;
has also other problemstotal_rows
is even returning the amount of record? and within the array$dados
has two keys which is assigned the same value$this->aniver->aniversarianteMes()
Why? There are enough mistakes so give aexception Unsupported operand types
– novic
I hadn’t even noticed that, now I’ve arranged a lot of thanks.
– Natan Melo
Managed to solve everything?
– rray
All good. Thank you very much
– Natan Melo