Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

show data in template???


2 Posts   976 Views


19 December 2008 at 6:14am Community Member, 192 Posts

I write a function (function that is call after printing search button) that return me an array $rec like this:

[0] => Array
[nome] => prova 1
[tipologia] => 1

[1] => Array
[nome] => elisa
[tipologia] => 1


this is a part of my function. How can show data in template?
If I write $PrintName and $PrintTipo I have errors.. sorry but form me is a big big problem show data in template with silverstripe..

$dos = new DataObjectSet();

for($i=0; $i<count($rec);$i++)
print_r($rec[$i]['nome']);echo '<br>'.'<br>';
$dos->push(new ArrayData(array("PrintName"=>$rec[$i]['nome'],"PrintTipo"=>$rec[$i]['tipologia'])));

return $this->customise($dos)->renderWith(array('SearchPage_results', 'Page'));

thanks for help..


22 December 2008 at 11:17pm Community Member, 192 Posts

nobody can help me??