Tengo esto en edit.php
Código PHP:
<?if(isset($fields)):?>
<?if (is_array($fields)):?>
<?foreach($fields as $name=>$field):?>
<div class="form-group">
<?$cf_name = 'cf_'.$name?>
<?if($field['type'] == 'select' OR $field['type'] == 'radio') {
$select = array(''=>'');
foreach ($field['values'] as $select_name) {
$select[$select_name] = $select_name;
}
} else $select = $field['values']?>
<?if(!isset($field['categories']) OR in_array($ad->category->id_category, $field['categories'])):?>
<?=Form::cf_form_tag('cf_'.$name, array(
'display' => $field['type'],
'label' => $field['label'],
'tooltip' => (isset($field['tooltip']))? $field['tooltip'] : "",
'default' => $ad->$cf_name,
'options' => (!is_array($field['values']))? $field['values'] : $select,
'required' => $field['required'],
'categories'=> (isset($field['categories']))? $field['categories'] : "",))?>
<?endif?>
</div>
<?endforeach?>
<?endif?>
<?endif?>
<?endif?>
Muchísima Gracias