简体   繁体   English

需要有关Zend Framework Paginator的帮助

[英]Need help with zend framework paginator

I wanted to generate a table with dymanic columns and rows 我想生成一个具有动态列和行的表

Example if i have a array of 如果我有一个数组的例子

1.1, 1.2, 1.3, 1.4
2.1, 2.2, 2.3, 2.4
3.1, 3.2, 3.3, 3.4

Currently is displaying 1.1 1.2 1.3 1.4 then 2.1 2.2 2.3 2.4 ...etc 当前显示1.1 1.2 1.3 1.4然后2.1 2.2 2.3 2.4 ...等

but I wanted to display 1.1 ,2.1, 3.1 then 1.2 2.2 2.3 ... etc 但是我想显示1.1,2.1,3.1然后1.2 2.2 2.3 ...等等

Rather then display all the row values for that particular row. 而是显示该特定行的所有行值。 I wanted to display all the column values at once. 我想一次显示所有列值。

In c++ i know you have to use nested for loop in order to achieve this 在C ++中,我知道您必须使用嵌套的for循环才能实现此目的

for (int i=0; i< col_size; i++)
{
    for (int j=0; j < row_size; j++)
    {
        cout << a[i][j];
    }
}

But how can it be done using Zend framework plus im also using zend paginator 但是如何使用Zend框架加上即时消息也可以使用zend paginator

Is there any method I can use to determine the column size? 有什么方法可以用来确定列大小?

My Current code is 我当前的代码是

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

My custom helper 我的自定义助手

    public function providerSearchResults($row)
    {
          echo $row['businessName']
          echo $row['cpuPrice']
          echo $row['hdPrice'];
          .....
          echo $row['ramPrice];


}

Thanks so much! 非常感谢!

You Can Use A Nested for loop in Php As well How ever You have an option of vprintf, printf or fprintf as well.. wheich u can use inside a forloop like 您也可以在Php中使用嵌套的for循环。但是,您也可以选择vprintf,printf或fprintf。

forloop printf("%d%d%d",i) forloop printf(“%d%d%d”,i)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM