[eluser]Gwarrior[/eluser]
Code:
function create_loop($loop_post_name, $content, $order="desc") {
return 'foreach ($test as $t) :';
}
function loop_data() {
return 'echo $t->example';
}
function end_loop() {
return 'endforeach;';
}
Above is an example of what I speak of. It's pretty imperative that it functions this way, as I have designed an entire CMS thus far around this model. Yet when I run it, it generates the error:
Quote:Fatal error: Cannot redeclare create_loop() (previously declared in C:\wamp\www\contentcreator\system\application\helpers\cc_helper.php:42) in C:\wamp\www\contentcreator\system\application\helpers\cc_helper.php on line 42
Here is my usage of it:
Code:
<?php create_loop('News Posts', 'article'); ?>
<?php end_loop(); ?>
So obviously I am doing something wrong. Problem is, I have no idea what that something may be. Any help would be great!
*ps, the functions are being called from a helper and I am aware they would produce no content and an error if ran this way, but I can even get to that point, therefore I didn't include database calls and other things that would be looped.