0

my schema.yml :

User:
  columns:
    id:
      type: integer(4)
      autoincrement: true
      primary: true
    username:
      type: string(255)
    password:
      type: string(255)
  attributes:
    export: all
    validate: true

Group:
  tableName: group_table
  columns:
    id:
      type: integer(4)
      autoincrement: true
      primary: true
    name:
      type: string(255)
  relations:
    Users:
      foreignAlias: Groups
      class: User
      refClass: GroupUser

GroupUser:
  columns:
    group_id:
      type: integer(4)
      primary: true
    user_id:
      type: integer(4)
      primary: true
  relations:
    Group:
      foreignAlias: GroupUsers
    User:
      foreignAlias: GroupUsers
additional:
  columns:
    id:
      type: integer(4)
      autoincrement: true
      primary: true
    new:
      type: string(255)
  attributes:
    export: all
    validate: true

i generated new module:

php symfony doctrine:generate-module --with-show --non-verbose-templates frontend user User

and i have form add user:

http://localhost/user/new

image: http://img692.imageshack.us/img692/7726/znew.png

i would like add for this form input new from the module additional and change the sfWidgetFormDoctrineChoice for multiple checkbox. how can i make it?

THX!

1
  • 2
    This question and your previous one indicate that your missing fundamental Symfony knowledge. Go through the Jobeet Tutorial. It will save you from many mistakes and save you time in the long run. Commented Jun 24, 2011 at 19:32

1 Answer 1

1

sfWidgetFormDoctrineChoice has an option called 'expanded' that if it's on true then will display the options with checkboxes (check this example from the symfony's Jobeet).

In your UserForm.class.php you have to put something like this (check your BaseUserForm.class.php)

<!-- lib/form/doctrine/UserForm.class.php -->
...
public function configure(){

    $this->setWidget('groups_list', new sfWidgetFormDoctrineChoice(array(
              'multiple' => true, 
              'model' => 'Group', //check that on your base
              'expanded' => true, //set checkboxs
    )));

}
...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.