Forum Moderators: coopster
I am trying to output the pages as links in my script, but am having trouble with the output:
for ($i = 1; $i <= $total_pages; $i++){
$output = ($page == $i) ? $i : '<a href="?page='.$i.'">'.$i.'</a>';
echo $output." ";
The problem is it outputs it at the very top of the page. I am trying to get it to output in the content section of the page. I know that I can treat it like a string and then return that string as output, but I am having trouble with the syntax. This is what I have so far:
$output = '';
for ($i = 1; $i <= $total_pages; $i++){
$this->output .= ($page == $i) ? $i : '<a href="?page='.$i.'">'.$i.'</a>';//SO THIS IS THE LINE I THINK I AM SCREWING UP!
return $this->output." ";
This only returns the first page and not as a link. Can anybody tell me what I am doing wrong? Thanks.