2011-09-27 58 views
0

我想生成dymanic列和行是否需要Zend框架分页程序帮助

实施例的表,如果我有

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 ...等

相反TH显示该特定行的所有行值。我想要一次显示所有列值。

在C++中我知道你有嵌套的循环,以达到使用该

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]; 


} 

非常感谢!

回答

0

你可以使用嵌套的for循环在PHP作为以及如何过你vprintf,printf或者fprintf中的一个选项,以及.. wheich u能一个for循环内使用像

for循环 的printf(“%d %d%d“,i)