Hi,
I am going to use the silverstirpe templating to provide some complex merging (fields and conditional paragraphs) and I'd like to validate their use of the templating first. It will look like this...
<% if Something %>
{$SomethingText}
<% else %>
{$SomethingElseText}
<% end_if %>
by having a relating object that I take the above info and wrap
//$str = string from above that the user can edit
$ad = new ArrayData(array('RelevantObject' => $do));
$t = SSViewer::fromString('<% control RelevantObject %>'.$str.'<% end_control %>');
$strMerged = $vd->customise($ad)->renderWith($t);
my issue is that users are users, meaning I am sure they will put things like...
{$SomeingElllse} or <% endifhere %>
which of course will result in some unexpected output and unhappy folks... so...
can anyone advise of a way to ensure their use of the syntax is ok and that they only use Something and SomethingText etc exist on the relevant object?