Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How to call a function from a control block

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

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

Page: 1
Go to End
Author Topic: 1574 Views
  • kpombar
    Avatar
    Community Member
    2 Posts

    How to call a function from a control block Link to this post

    Hello,
    I have a function in the Page_Controller called A():
    function A()
       {
          return "hello world!!";
       }

    I need to call this function from my page.css. This works ok:

    <div class="col-1">
    <ul class="navigation">
    <li>$A</li>
    </ul>
    </div>

    But if I call to A() function from a control block not works!!A() function shows nothing!!

    <div class="col-1">
    <ul class="navigation">
    <% control Menu(1) %>   
    <li>$A</li>
    <% end_control %>
    </ul>
    </div>

    why?
    Sorry for my bad english and Thanks in advance!

  • Fuzz10
    Avatar
    Community Member
    786 Posts
    1574 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.