I use the sfDoctrinePager class to paginate results. I've seen in the
1.3/1.4 what's new article that the pagers now implement the Iterator
and Countable interfaces. I say "cool, let's try it" so I did that:
<?php if (count($my_pager)): ?>
...
<?php foreach ($my_pager as $object): ?>
<?php var_dump($object) ?>
<?php endforeach; ?>
...
<?php endif; ?>
The count() function works fine, but the foreach() doesn't. The
$object that I expect to be a MyClass object is actually a
sfOutputEscaperArrayDecorator object. It's an array of my objects, and
not one of my objects, as I hoped...
Do I misunderstand the pager Iterator interface? Or is it a bug?
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.