Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

17478 Posts in 4473 Topics by 1972 members

Archive

SilverStripe Forums » Archive » parametr pass to <% control %>

Our old forums are still available as a read-only archive.

Page: 1
Go to End
Author Topic: parametr pass to <% control %> 631 Views
  • ojalà
    avatar
    Community Member
    87 posts

    parametr pass to <% control %> Link to this post

    Hi!
    my problem is understand what kind of object pass to <% control %>.
    for example I have this: $data = array('Nome' => $data['nome']);
    So I can use :
    <% if Nome %> and <% control Nome %>
    Why?
    the same is valid if I use a name of function? can you explain me?I read http://doc.silverstripe.com/doku.php?id=templates&s=renderwith but is not clear

  • Willr
    avatar
    Moderator
    2746 posts

    Re: parametr pass to <% control %> Link to this post

    <% control %> is used to loop over sets of data, or values in 1 DataObject. So any function which returns a 'DataObjectSet' can be used with a control. It is like the foreach() loop in PHP

    $data = array('Nome' => $data['nome']); cannot be controlled over as it is only 1 value. So you can check it exists via if Nome. But you would output it in the template as $Nome to get the value

    631 Views
Page: 1
Go to Top

Currently Online: PatJnr, ricpersi

Welcome to our latest member: holy noli

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

Comments on this website? Please give feedback.