[PHPTAL] PHPTAL_RepeatController and PDOStatement
Julien Fredon
julien.fredon at imaginance.com
Fri Feb 1 14:12:10 CET 2008
Hello phptal users,
I have a problem with PHPTAL and PDO (www.php.net/pdo) when i use
tal:repeat.
PHPTAL_RepeatController seems angry with PDOStatement.
PDOStatement is not "Iterator" but it's "Traversable"
I changed the following code (RepeatController line 58) :
if ($source instanceof IteratorAggregate) $source =
$source->getIterator();
else if (!is_array($source) && !($source instanceof Iterator))
$source = array();
with
if ($source instanceof IteratorAggregate) $source =
$source->getIterator();
else if (!is_array($source) && !($source instanceof Iterator)
&& !($source instanceof Traversable)) $source = array();
but i'm not sure that it's the good or the best solution.
--
*Julien
*
-------------- section suivante --------------
Une pi�ce jointe HTML a �t� enlev�e...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20080201/d8180865/attachment.htm
More information about the PHPTAL
mailing list