【发布时间】:2011-09-27 17:46:16
【问题描述】:
我想生成一个包含动态列和行的表
如果我有一个数组的例子
1.1, 1.2, 1.3, 1.4
2.1, 2.2, 2.3, 2.4
3.1, 3.2, 3.3, 3.4
当前显示 1.1 1.2 1.3 1.4 然后 2.1 2.2 2.3 2.4 ...等
但我想显示 1.1 ,2.1, 3.1 然后 1.2 2.2 2.3 ...等
然后显示该特定行的所有行值。我想一次显示所有列值。
在 c++ 中,我知道你必须使用嵌套的 for 循环才能实现这一点
for (int i=0; i< col_size; i++)
{
for (int j=0; j < row_size; j++)
{
cout << a[i][j];
}
}
但是如何使用 Zend 框架加上 im 也使用 zend 分页器来完成
有什么方法可以用来确定列的大小吗?
我当前的代码是
<div class ="outcome">
<?php
foreach($this->paginator as $row){
$this->providerSearchResults($row); // using custom helper
}
echo '</ul>';
$params = array('location' => $this->location,'industryType' => $this->industryType); // used to pass to the paginationcontrol
echo $this->paginationControl($this->paginator,'Sliding','paginationcontrol.phtml',$params);
</div>
我的自定义助手
public function providerSearchResults($row)
{
echo $row['businessName']
echo $row['cpuPrice']
echo $row['hdPrice'];
.....
echo $row['ramPrice];
}
非常感谢!
【问题讨论】:
标签: zend-framework zend-paginator