i want to output an array containing numbers.
I'm creating the array like this (it recieved the statistics for the last 7 days) :
<?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();
Use of the array in my template.php :
$chart->inlineGraph(array('hits' => $st_job), array('Monday', 'Tuesday', 'Wednesday' ....), 'div_id');
When i try to access to my array it fails because the function i use must have an array which is supposed to contain for example (43,5,87,3,29,8,10) , and when i var_dump($st_job)
(my array)
object(sfOutputEscaperArrayDecorator)#363 (3) { ["count":"sfOutputEscaperArrayDecorator":private]=> int(0) ["value":protected]=> array(0) { } ["escapingMethod":protected]=> string(16) "esc_specialchars" }
Do you have any idea of what i'm doing wrong ?
Thank you
Yes, symfony is set to automatically apply escaping strategies to the data you pass from your controllers to your views. You can either remove the setting, which is not recommended, or use:
$original_array = $sf_data->getRaw('st_job');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With