bmidget/kohana-formo

Blueprint_template has broken the ability to use individual field tempates

Closed this issue · 1 comments

4cb38cd This commit

$items_form = Formo::form(['alias' => 'jobitems', 'blueprint' => true])
        ->orm('load', ['model'=> ORM::factory('jobitem')])
        ->set('blueprint_template' ,'tr_group_template');

Model -

    public function formo($form, $opts){
        $form->id->set(['driver'=> 'input|hidden', 'template' => 'stripped_field_template', 'attr' => ['class' => 'id-field span1',  'style' => 'display:hidden']]);

the template field is ignored and the default one is used over 'stripped_field_template'. It was working ok till I pulled the latest commit so its something in that.

Can also be reproduced without ORM.

        $items_form = Formo::form(['alias' => 'jobitems', 'blueprint' => true])
        ->orm('load', ['model'=> ORM::factory('jobitem')])      
        ->set('blueprint_template' ,'tr_group_template');
        $items_form->id->set('template','I get ignored');

        $form->add($items_form);
        $form->jobitems->set(['template' => 'items_group_template']);

Fixed by adding this back after line 1623

        if ($template = $this->get('template')) {
            $array['template'] = $template;
        }