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???


Reply


2 Posts   1002 Views

Avatar
bebabeba

Community Member, 193 Posts

19 December 2008 at 6:14am

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

Array
(
[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'])));
}
//var_dump($dos);die;

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

thanks for help..

Avatar
bebabeba

Community Member, 193 Posts

22 December 2008 at 11:17pm

nobody can help me??