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.

Template Questions /

Pass parameter


3 Posts   579 Views


Community Member, 62 Posts

18 September 2012 at 8:05pm

Edited: 18/09/2012 8:08pm

Why wouldn't this work?


<div class=" show$Opt(Count) half$Opt(Half) clearfix">

*in page_controller of Page.php

   public function getOpt($opt = 'Count'){
             return foo;
             return bar;


Community Member, 18 Posts

20 September 2012 at 8:13am

Well I think that u should call for getOpt(...) instead of Opt, and the second thing is that u should a pass a string to a function.


Community Member, 62 Posts

21 September 2012 at 7:41am

The reason I ask is that I've only seen numbers passed as parameters in all the Silverstripe examples. I will take the string approach and see if that makes the fix.