php - Symfony : error while accessing an array -


i want output array containing numbers.

i'm creating array (it recieved statistics 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 array in template.php :

$chart->inlinegraph(array('hits' => $st_job), array('monday', 'tuesday', 'wednesday' ....), 'div_id'); 

when try access array it fails because function use must have array supposed contain example (43,5,87,3,29,8,10) , , when 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 have idea of i'm doing wrong ?

thank you

yes, symfony set automatically apply escaping strategies data pass controllers views. can either remove setting, not recommended, or use:

$original_array = $sf_data->getraw('st_job'); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -