2016-04-27 7 views
0

Ich habe rywa/silverstripe-foundation-forms mit composer und meinem composer.json installiert. Ich sehe nicht, wie das funktioniert. Ich habe ein Formular in der Basisklasse medium-6 columns erstellt. Dies ist mein Code:run rywa/silverstripe-foundation-forms

public function ContactForm() { 
     $myForm = Form::create(
      $this, 
      __FUNCTION__, 
      FieldList::create(
       TextField::create('YourName','Your name'), 
       TextareaField::create('YourComments','Your comments')->addExtraClass('medium-6 columns') 
      ), 
      FieldList::create(
       FormAction::create('sendContactForm','Submit') 
      ), 
      RequiredFields::create('YourName','YourComments') 
     ); 

     return $myForm; 
    } 

Das Problem ist die Form, in dem Eingang eine Klasse Container fügt

Antwort

0

Sie sollten FoundationForm Unterklasse afaik, so etwas zu tun, wie:

public function ContactForm() { 
    $myForm = FoundationForm::create(
     $this, 
     __FUNCTION__, 
     FieldList::create(
      TextField::create('YourName','Your name'), 
      TextareaField::create('YourComments','Your comments') 
      ->addExtraClass('medium-6 columns') 
     ), 
     FieldList::create(
      FormAction::create('sendContactForm','Submit') 
     ), 
     RequiredFields::create('YourName','YourComments') 
    ); 

    return $myForm; 
} 

sollte funktionieren.