Changeset 9016
- Timestamp:
- 05/16/08 20:07:38 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfYUIPlugin/branches/jtodd/lib/helper/YUIDatatableHelper.php
r8968 r9016 66 66 * @param array $objects Array of hydrated objects like $objects = Doctrine::getTable('EmailInformation')->findAll() 67 67 * @param array $fields Associative array of fields and column definitions 68 * @param array $actions Associative array of the form: array('Edit' => url_for('EmailInformation/edit'));68 * @param array $actions Associative array of the form: array('Edit' => array('href' => url_for('EmailInformation/edit'))); 69 69 */ 70 70 function yui_datatable_doctrine_object_to_data_js($objects,$fields,$actions) … … 81 81 { 82 82 $js_data .= 'actions: '; 83 foreach($actions as $action => $ url)83 foreach($actions as $action => $options) 84 84 { 85 $js_data .= '"<a href=\"'.$url.'?id='.$object->getId().'\">'.$action.'</a>" '; 85 $js_data .= '"<a '; 86 foreach($options as $option => $value) 87 { 88 $val = str_replace($value, '#id#', $object->getId()); 89 $js_data .= ' '.$option.'=\"'.$val.'\" '; 90 91 } 92 $js_data .=' \">'.$action.'</a>" '; 86 93 } 87 94 $js_data .= ',';