Problem WYLoopElement in "function"

General discussions about WebYep
ritasboss
Posts: 15
Joined: Mon Jun 06, 2011 12:00 pm

Problem WYLoopElement in "function"

Postby ritasboss » Mon Oct 21, 2013 1:22 pm

I'm trying to use "WYLoopElement" in a function. That does not work. Where is my mistake?
Classic use works:

Code: Select all

<?php
foreach (WYLoopElement::aLoopIDs("Loop Package") as $webyep_oCurrentLoop->iLoopID) { $webyep_oCurrentLoop->loopStart(false); // WebYepV1
... // Loop WY- and PHP-Stuff
$webyep_oCurrentLoop->loopEnd(); } // WebYepV1
?>

This does not work. Why?

Code: Select all

<?php
function myFunction() {
foreach (WYLoopElement::aLoopIDs("Loop Package") as $webyep_oCurrentLoop->iLoopID) { $webyep_oCurrentLoop->loopStart(false); // WebYepV1
... // Loop WY- and PHP-Stuff
$webyep_oCurrentLoop->loopEnd(); } // WebYepV1
}
?>

Return to “WebYep (english)”

Who is online

Users browsing this forum: No registered users and 3 guests