Files
pmgr/views/elements/form_table.ctp
abijah 58d3cbf66b First pass at entering charges for a lease. This works, but does not have the ability to add multiple charges, and does not mirror the payment method, which is ajax based.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@231 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-07-06 18:34:44 +00:00

34 lines
944 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($config['prefix']) && !isset($config['no_prefix']))
$field = $config['prefix'] . '.' . $field;
elseif (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'),
));