Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Remove field from Fieldset
  • Hey guys,
    doesn't exist any function in fieldset class that can remove a field from a fieldset instance? Something like that :
    $form = \Fieldset::instance('complex_form');
    $form->remove('field_name');
    
    
    Currently I do :
    // Update existent fieldset
    $user_form = \Fieldset::instance('user_form');
    $user_form
     ->add('new_password', ...)
     ->add('repeat_new_password', ...);
      
    // Remove creation "password repeat" field
    $update_form = $user_form->field();
    unset($update_form['password_repeat']);
      
    $view->form = $update_form;
    

    but, personally, I think it's not convenient

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!