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.

Archive /

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

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

How to call a function from a control block


Reply


2 Posts   1639 Views

Avatar
kpombar

Community Member, 2 Posts

4 February 2008 at 11:47pm

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!

Avatar
Fuzz10

Community Member, 787 Posts

5 February 2008 at 8:50am

Did you search the forum ?

http://www.silverstripe.com/site-builders-forum/flat/6619