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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

How to call a function from a control block


Go to End


2 Posts   2198 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, 791 Posts

5 February 2008 at 8:50am