Ok, having problem separating out a view for this controller, because if I put the output into a view, the view would never be called (due to an infinite loop.)
Any input on the best solution to this? How would you solve this issue? Be creative. Have fun.
<?php
class Bottles_of_beer extends Controller {
function Bottles_of_beer()
{
parent::Controller();
}
function index()
{
$this->sing();
}
function sing()
{
$j = 1;
$store_inventory = 10000;
while ($store_inventory > 0)
{
for ($i = 99; $i = 0; $i -= $j)
{
echo "$i bottles of beer on the wall.\n";
echo "Take $j down, pass it around.\n";
}
$store_inventory--;
if ($store_inventory < 5000) { $store_inventory += 5001; }
echo "Go to the store, buy some more.\n";
}
}
}
// End of file: bottles_of_beer.php