-
-
Save hailwood/354b58af77170d551ec4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Page { | |
public function Repeat1($times) | |
{ | |
$list = new ArrayList(); | |
$formatter = new NumberFormatter('en-NZ', NumberFormatter::SPELLOUT); | |
for ($i = 1; $i <= $times; $i++) { | |
$list->push(array('Num' => $i, 'Word' => ucwords(strtolower($formatter->format($i))))); | |
} | |
return $list; | |
} | |
public function Repeat2($times) | |
{ | |
$list = new ArrayList(); | |
$formatter = new NumberFormatter('en-NZ', NumberFormatter::SPELLOUT); | |
for ($i = 1; $i <= $times; $i++) { | |
$list->push(array('Num2' => $i, 'Word2' => ucwords(strtolower($formatter->format($i))))); | |
} | |
return $list; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% loop $Repeat1(5) %> | |
<h2>Inside repeat one iteration {$Num}</h2> | |
<% loop $Up.Repeat2(5) %> | |
<h3>Inside repeat two iteration {$Num2}</h3> | |
<p>Direct: {$Num}</p> | |
<p>UP: {$Up.Num}</p> | |
<p><%-- UP.UP: {$Up.Up.Num} --%> (already at top of scope error)</p> | |
<p>TOP: {$Top.Num}</p> | |
<% end_loop %> | |
<hr> | |
<% end_loop %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment