Hi Folks,
Due to a whole bunch of things i've been sideways of modx for a while, but i'm back on track and trying to get my projects i was working on up again.
One of these projects is rewriting an evolution website(backend) to Revolution. (what better way is there to learn, right?). However, in this evolution website they use a custom class with several functions that return values to the frontend.
For example this is such a function:
function getTeaserValue() {
$select = "SELECT * FROM teaser";
$query = mysql_query($select);
$value = mysql_fetch_array($query);
return $value;
And in the frontend they use it like so:
$teaser = new nameofcustomclass();
$value = $teaser->getTeaserValue();
<a href="<?php echo $value['linklocation']?>" title="<?php echo $value['value']?>"><?php echo $value['value']?></a>
It's (simply) passing on an array, right?
I figured, i'd rewrite it to:
function getTeaserValue() {
global $modx;
$select = $modx->newQuery('Teaser');
$value = $modx->getCollection('Teaser', $select);
return $value;
}
But that ship doesn't sail. What am i doing wrong or maybe i could do better? (it's a class of approx. 900 lines code, i really want to understand what i'm doing

)