2016-04-27 9 views
0

私はrywa/silverstripe-foundation-formsを作者と一緒にインストールしましたが、私のcomposer.jsonはそこにあります。私はこの機能がどういうものか分かりません。私は基礎を追加するクラスmedium-6 columnsでフォームを作成しました。これは私のコードです:run rywa/silverstripe-foundation-forms

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; 
} 

動作するはずです:

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; 
    } 

問題は、フォームであなたがそうのようなものがやって、私の知る限りでFoundationFormをサブクラス化する必要があり、入力

答えて

0

でクラスコンテナを追加します。