Skip to main content

Home/ foograde/ Group items tagged validator

Rss Feed Group items tagged

Adán Muguiro

SAKRA WebStudio: Remove PostValidator in Symfony - 0 views

  •  
    quitar un post validator definido en una clase base
Adán Muguiro

Modificando los widgets en la acción - 0 views

  • // in modules/foo/actions/actions.class.php // Define the form $this->form = new ContactForm();   // Add an empty option to the list of choices of a 'choice' widget $form->getWidget('language')->setOption('add_empty', 'Please choose a language'); // Add a 'gender' list of options widget $form->setWidget('gender', new sfWidgetFormChoice(array('expanded' => true, 'choices' => array('m' => 'Male', 'f' => 'Female')), array('class' => 'gender_list'))); // Change the HTML attributes of the 'subject' widget $form->getWidget('subject')->setAttribute('disabled', 'disabled'); // Remove the 'subject' field unset($form['subject']) // Note: You cannot remove just the widget. Removing a widget will also remove the related validators   // Change the 'min_length' error in the 'message' validator $form->getValidator('message')->setMessage('min_length', 'Message too short'); // Make the 'name' field optional $form->getValidator('name')->setOption('required', false);
  •  
    Varias cosas que se pueden modificar en los widgets desde la acción.
1 - 2 of 2
Showing 20 items per page