tags:

views:

31

answers:

1

How get name of field type file in beforeSave()? I have form with many file filed, and i must get names of each...

+1  A: 

Well, that obviously depends on what name you give it. If that's unknown, you can simply loop through the data array and pick the one that looks like a file array:

foreach ($this->data[$this->alias] as $field => $contents) {
    if (isset($contents['tmp_name'])) {
        // This is the $field you're looking for
    }
}
deceze