Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » Nested Controls

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

Page: 1
Go to End
Author Topic: 1443 Views
  • Aperage
    Community Member
    6 Posts

    Nested Controls Link to this post

    Hey hey,

    Is it possible to have nested control?

    I have this code here

    <% control getSpeciesType %>
    <div class="species">
    <% control ShowSpeciesByType %>
    <% end_control %>
    <% end_control %>

    Both custom functions returns a DataObjectSet. But i've tried debugging by putting an exit(); in my nested function (ShowSpeciesByType) but the script doesn't even get there

    So is it possible to have nested Controls??


  • Willr
    Forum Moderator
    5502 Posts

    Re: Nested Controls Link to this post

    Yes you can have nested controls but once your in the getSpeciesType control then the scope of the template changes to the SpeciesType object so whatever control you want in that - eg ShowSpeciesByType needs to be a function in the SpeciesType class.

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.