Skip to content

Instantly share code, notes, and snippets.

@donut
Created February 17, 2009 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donut/65870 to your computer and use it in GitHub Desktop.
Save donut/65870 to your computer and use it in GitHub Desktop.
<?php
/**
* sfGuardUserProfile form.
*
* @package form
* @subpackage sfGuardUserProfile
* @version SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
*/
class sfGuardUserProfileForm extends BasesfGuardUserProfileForm
{
public function configure () {
unset($this['user_id'], $this['created_at'], $this['updated_at']);
$this->validatorSchema['first_name'] = new sfValidatorString(array('max_length' => 50));
$this->validatorSchema['last_name'] = new sfValidatorString(array('max_length' => 50));
$this->validatorSchema['email'] = new sfValidatorEmail(array('max_length' => 100, 'required' => false));
$this->validatorSchema['phone'] = new sfValidatorString(array('max_length' => 25, 'required' => false));
$this->validatorSchema['address'] = new sfValidatorString(array('max_length' => 255, 'required' => false));
$this->validatorSchema['city'] = new sfValidatorString(array('max_length' => 255, 'required' => false));
$this->validatorSchema['state'] = new sfValidatorString(array('max_length' => 50, 'required' => false));
$this->valdiatorSchema['zip'] = new sfValidatorString(array('max_length' => 50, 'required' => false));
$widgets = array('first_name', 'last_name', 'email', 'phone', 'address', 'city', 'state', 'zip');
foreach ($widgets as $name => $widget)
$this->widgetSchema[$widget]->setAttribute('class', 'text');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment