gpt4 book ai didi

php - 交响乐 : error while accessing an array

转载 作者:可可西里 更新时间:2023-11-01 13:40:45 26 4
gpt4 key购买 nike

我想输出一个包含数字的数组。

我正在创建这样的数组(它收到了过去 7 天的统计信息):

   <?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 类.php

$this->st_job = Doctrine::getTable('StJob')->getStatisticsTeams();

在我的 template.php 中使用数组:

$chart->inlineGraph(array('hits' => $st_job), array('Monday', 'Tuesday', 'Wednesday' ....), 'div_id');

当我尝试访问我的数组时它失败了因为我使用的函数必须有一个应该包含例如 (43,5,87,3,29,8,10 ) ,当我 var_dump($st_job) (我的数组)

object(sfOutputEscaperArrayDecorator)#363 (3) { ["count":"sfOutputEscaperArrayDecorator":private]=>  int(0) ["value":protected]=>  array(0) { } ["escapingMethod":protected]=>  string(16) "esc_specialchars" } 

你知道我做错了什么吗?

谢谢

最佳答案

是的,symfony 设置为自动将转义策略应用于您从 Controller 传递到 View 的数据。您可以删除不推荐的设置,或使用:

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

关于php - 交响乐 : error while accessing an array,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3886832/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com