开发者

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

but I wanted to display 1.1 ,2.1, 3.1 then 1.2 2.2 2.3 ... etc

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

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

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 开发者_StackOverflow社区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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜