git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@220 97e9348a-65ac-dc4b-aefc-98561f571b83
32 lines
827 B
PHP
32 lines
827 B
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
/* form_table.ctp */
|
|
/*
|
|
*
|
|
* @filesource
|
|
* @copyright Copyright 2009, Abijah Perkins
|
|
* @package pmgr
|
|
*/
|
|
|
|
|
|
$rows = array();
|
|
foreach ($fields AS $field => $config) {
|
|
if (!isset($config['name']))
|
|
$config['name'] = implode(' ', array_map('ucfirst', explode('_', $field)));
|
|
if (!isset($config['opts']))
|
|
$config['opts'] = null;
|
|
|
|
if (isset($field_prefix) && !isset($config['no_prefix']))
|
|
$field = $field_prefix . '.' . $field;
|
|
|
|
$config['opts']['label'] = false;
|
|
$rows[] = array($config['name'],
|
|
$form->input($field, $config['opts']));
|
|
}
|
|
|
|
echo $this->element('table',
|
|
compact('class', 'caption', 'headers',
|
|
'rows', 'row_class', 'suppress_alternate_rows') +
|
|
array('column_class' => array('field', 'value'),
|
|
));
|