Je souhaite générer un tableau contenant des nombres.Symfony: erreur lors de l'accès à un tableau
Je crée le tableau comme celui-ci (il REÇU les statistiques des 7 derniers jours):
<?php public function getStatisticsTeams()
{
$tab = array();
for($i=7;$i=0;$i--)
{
$q = Doctrine_Query::create()
->from('stJob j')
->where('j.created_at = ?', date('Y-m-d h:i:s' , time() - 86400 * $i))
->execute()
->count();
$tab[] = $q;
}
return $tab;
}
action.class.php
$this->st_job = Doctrine::getTable('StJob')->getStatisticsTeams();
Utilisation du tableau dans mon modèle .php:
$chart->inlineGraph(array('hits' => $st_job), array('Monday', 'Tuesday', 'Wednesday' ....), 'div_id');
Quand je tente d'accéder à mon tableau il échoue parce que la fonction i utiliser doit avoir un tableau qui est censé contenir, par exemple (43,5,87,3,29,8,10), et quand je var_dump($st_job)
(mon tableau)
object(sfOutputEscaperArrayDecorator)#363 (3) { ["count":"sfOutputEscaperArrayDecorator":private]=> int(0) ["value":protected]=> array(0) { } ["escapingMethod":protected]=> string(16) "esc_specialchars" }
-vous avoir une idée de ce que je fais mal?
Merci
merci;) 3char –
Le rapport de bogue correspondant: http://trac.symfony-project.org/ticket/1472 – Tapper