Hi all,

I'm starting to write a Table widget, so that you can assign data to it, 
and have it handle rendering the data to HTML, perhaps with built in 
paging support.

the plan is to have something along these lines:


$table = new sfTable();

$table->setColumns(array(
   'col1' => array('label' => 'Column 1'
                   'sortable' => true,
                   'attributes' => array('class' => 'whatever')),
   'col2' => array('label' => 'Column 2'),
));

foreach($data as $d)
{
   $row = new sfTableRow(array(
     'col1' => array(
                'value' => $d['something'] . ' ' . $d['something_else'],
               ),
     'col2' => array(
                'value' => $d['wibble']
               ),
   ));
   $table->addRow($row);
}

$table->setAlternating(...


in the view, you would simply do

<?php echo $table; ?>

Thoughts/feedback?  Has anyone started something like this?

-- 

Ian P. Christian ~ http://pookey.co.uk

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to