Quote from: hotdiggity at Jun 10, 2010, 11:08 PM
Try sending $modx as an argument to the function
How do I do this?
Yep, knew the echos were a no no. I’ll fix ’em up once I got the basics working - unless you think echos inside functions inside snippets could be the problemo?
Try this first, I don’t think it’s your problem, but let’s rule it out.
when you call the function:
For the function itself:
function paginate ($modx) {
}
Be sure to remove the global $modx so the argument will be used.
[update] Just took another look, you should send all the other variables from outside the function that it needs as arguments too (e.g. $total_pages, $page_number, etc.). That’s why you’re not getting any output, the function is creating new local instances of those variables and ignoring the ones you’ve created elsewhere. You need to either make them all global or (the preferred method) send them as arguments.