auraphp / Aura.Input

Tools to describe HTML form fields and values.
MIT License
65 stars 11 forks source link

Iterating via objects #4

Closed harikt closed 11 years ago

harikt commented 11 years ago

The idea is to use it

$fields = $form->getFields();
// Pass to view

// In view 
foreach ($this->fields as $name => $field) {
    echo $this->field(
        array_merge(
            $field->toArray(), 
           [
               'name' => $name, 
               'value' => '', 
               'label' => '' 
           ]
        )
    );
}

By the way asArray() is as of now. I prefer to change it as toArray() for it makes more sense.

pmjones commented 11 years ago

I think this is implemented in the "form" branch, which will get merged back to "develop" at some point.

harikt commented 11 years ago

ok.