I'm trying to get the next function into my (XML) output:
....
class HousePage_Controller extends Page_Controller {
function init() {
}
function getDir($id){
$doSet = new DataObjectSet();
$sqlQuery = new SQLQuery();
$sqlQuery->select = array('Filename');
$sqlQuery->from = array('File');
$sqlQuery->where = array('Filename LIKE \'%type%\' AND `ClassName` = \'Image\'');
$val = $sqlQuery->execute();
foreach($val as $value){
$record = array('Filename' => $value['Filename']);
$doSet->push(new ArrayData($record));
}
return $doSet;
}
}
The (XML) template looks like this:
....
<% if getDir(1) %>
<% control getDir(1) %>
<img>$Filename</img>
<% end_control %>
<% end_if %>
....
It looks like a normal query to me, but I don't get any output. Even not when I change the query or just try to shout something form the function into the output.
When I try ?showqueries the query doesn't show up.
Does anyone have an idea?