Zend table html helper

Is there a Zend helper to create an Html table and use an array as input?

0
source share
4 answers

partialLoop()probably best if you need a lightweight, easily customizable table generator. If you want something a little more than the business logic of reporting in Zend, check out zfdatagrid .

+2
source

Most of all I use partialLoop () to generate tables. But sometimes for simple data that does not require formatting, I use my simple view helper: https://gist.github.com/812481 . Using:

<?php echo $this->table()->setRows($rows); ?>

or...

<?php echo $this->table(null, $rows); ?>

$rows , toArray (Zend_Db_Table_Rowset, Doctrine_Collection ..). : , , :

echo $this->table()
  ->setCaption('List of something')
  ->setAttributes(array('class' => 'mytable', 'id' => 'currenciesList'))
  ->setColumns(array(
          'currency' => 'Currency',
          'rate' => 'Rate',
          'edit_options' => ''  // Custom column
      ))
    // content for custom column.
  ->setCellContent(
      '<a href="/currency/delete/{id}" class="deleteLink">Delete</a>', 'edit_options'
      )
  ->setFooter('Something to write in footer...')
  ->setEmptyRowContent('Nothing found')
  ->setRows($rows);

, partialLoop, - Zend_Date, Zend_Currency .

+2

zend. partialLoop, .

+1

PEAR HTML_Table. , . , , , .

Find more information at http://pear.php.net/package/HTML_Table/docs/latest/HTML_Table/HTML_Table.html

0
source

Source: https://habr.com/ru/post/1746008/


All Articles