Well, for anybody in a similar situation, I have solved this problem. It seems as though the second code only works like so:
<?php for ($i=1; $i<=$div_total; $i++) { ?> <?php echo $ajax->div($div_id . $i, array('style'=>'display:inline')); ?>test content<?php echo $i; ?><? php echo $ajax->divEnd($div_id . $i);?> <?php } ?> In other words, you cannot join the $ajax->div echo statement with another echo statement; it needs to stand on its own. Very strange. On Sep 10, 1:55 am, Anthony <[EMAIL PROTECTED]> wrote: > Well, it seems as though Cake is being picky... > > In my view which is rendered for the AJAX output, if I have this code, > it works: > > <?php echo $ajax->div('id1', array('style'=>'display:inline')); ?> > test content 1 > <?php echo $ajax->divEnd('id1'); ?> > <?php echo $ajax->div('id2', array('style'=>'display:inline')); ?> > test content 2 > <?php echo $ajax->divEnd('id2'); ?> > > However, the following code does not: > > <?php for ($i=1; $i<=$div_total; $i++) { > echo $ajax->div($div_id . $i, array('style'=>'display:inline')) . > 'test content' . $i . $ajax->divEnd($div_id . $i); > > } ?> > > Theoretically, the second code should output exactly the same > information as the first one. And if I go directly to the rendered > view in my browser, it does. However, when it comes to using it in an > AJAX environment, the first code outputs 'test content #' in each div > while the second code outputs a blank string in each div - ''. > > Thoughts? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---