Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » show data in template???

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

Page: 1
Go to End
Author Topic: 970 Views
  • bebabeba
    Avatar
    Community Member
    192 Posts

    show data in template??? Link to this post

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

  • bebabeba
    Avatar
    Community Member
    192 Posts

    Re: show data in template??? Link to this post

    nobody can help me??

    970 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.