Hi,
I know this is probably really easy but I just can't find anything in the docs or here on the forums...
I am just trying to do a simple for-loop inside a template, the number is coming from a variable in the database. This is what I want (done in php)
<?php for( $x=0;$x < $num;$x++) { ?>
Delegate <?php echo $x; ?> <input type="text" value="<?php echo $x; ?><br />
<?php } ?>
I have tried putting a function in my controller like this:
function delegates(num) {
for($x=0;$x < $num;$x++) {
$data .="Delegate $x";
}
return $data;
}
then calling it like this in the template:
<% control delegates( $num ) %><%end_control %>
but this isn't working
is there a way to do this?
Cheers
Mike