Hi all,
I just started building a page with SilverStripe and I really have no idea about calling a php-function with return values....
My goal is to validate the generated html code to xhtml 1.0 strict.
So I just did this:
mycode/ArticlePage.php:
class ArticlePage extends Page {
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Downloads', new HTMLEditorField('download','Downloads'));
}
function valideLinks($data) {
$data = str_replace('target="_blank"','',$data);
return $data;
}
}
themes/.../ArticePage.ss:
<div class="downloads">
$valideLinks($download)
</div>
RESULT:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /tmp/......templates.Layout.ArticlePage.ss on line 110
So how can I call a php-function, to pass values and get return values?
Thanks in advance