2011-09-27 59 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)