First shot at an actual working form to enter contact information. It only handles phone numbers at the moment, and it does NOT handle existing ones. It's a decent start though, and worth checking in. Next I'll have to handle existing phone numbers, and then addresses and emails. Of course, after that, I'll have to actually save everything to the database.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@209 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
31
site/views/elements/form_table.ctp
Normal file
31
site/views/elements/form_table.ctp
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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))
|
||||
$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'),
|
||||
));
|
||||
Reference in New Issue
Block a user