Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fieldset class - Equivalent to $val->run?
  • I've got this code: $form = Fieldset::factory('solution_main_update');
    $languages = Model_Language::find('all');
    foreach($languages as $language)
    {
    if(isset($solution_name[$language->language_code]))
    {
    $text = $solution_name[$language->language_code];
    }
    else
    {
    $text = '';
    } $form->add('name_'.$language->language_code, 'Name in '.$language->language_name, array('value' => $text), array(array('required')));
    }
    $form->add('submit', '', array('type' => 'submit', 'value' => 'Submit'));
    $data = $form->build(Uri::create('/admin/solutions/update/'.$id.'/main')); I think that should have 'required' set on each of the input boxes. Only question is, how do I do something like: if($val->run())
    {
    //Validation requirements have been met. Do something cool.
    } Thanks!
  • With a fieldset, I'm using $form->validation()->run() not $val->run() and that runs the validation check.
  • Ah, Thanks = ). Should have looked at the class API first = ) I think I probably owe you a beer by now, dude !
  • Ah, Thanks = ). Should have looked at the class API first = ) I think I probably owe you a beer by now, dude !
  • Glad I can be of help. I've certainly received my share of help--especially from Jelmer and Wanwizard.

Howdy, Stranger!

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

In this Discussion