root/trunk/lib/form/base/BaseBlogPostForm.class.php

Revision 48, 1.7 kB (checked in by nperriault, 8 months ago)

Upgraded scripts to use symfony 1.1, everything is broken, use with caution.

Line 
1 <?php
2
3 /**
4  * BlogPost form base class.
5  *
6  * @package    form
7  * @subpackage blog_post
8  * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
9  */
10 class BaseBlogPostForm extends BaseFormPropel
11 {
12   public function setup()
13   {
14     $this->setWidgets(array(
15       'id'           => new sfWidgetFormInputHidden(),
16       'title'        => new sfWidgetFormInput(),
17       'slug'         => new sfWidgetFormInput(),
18       'body'         => new sfWidgetFormTextarea(),
19       'author_id'    => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),
20       'is_published' => new sfWidgetFormInputCheckbox(),
21       'created_at'   => new sfWidgetFormDateTime(),
22       'updated_at'   => new sfWidgetFormDateTime(),
23     ));
24
25     $this->setValidators(array(
26       'id'           => new sfValidatorPropelChoice(array('model' => 'BlogPost', 'column' => 'id', 'required' => false)),
27       'title'        => new sfValidatorString(array('max_length' => 255)),
28       'slug'         => new sfValidatorString(array('max_length' => 255)),
29       'body'         => new sfValidatorString(array('required' => false)),
30       'author_id'    => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
31       'is_published' => new sfValidatorBoolean(),
32       'created_at'   => new sfValidatorDateTime(array('required' => false)),
33       'updated_at'   => new sfValidatorDateTime(array('required' => false)),
34     ));
35
36     $this->widgetSchema->setNameFormat('blog_post[%s]');
37
38     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
39
40     parent::setup();
41   }
42
43   public function getModelName()
44   {
45     return 'BlogPost';
46   }
47
48
49 }
50
Note: See TracBrowser for help on using the browser.