2016-08-22 51 views
1

我們使用銀條2.4。我有大約2000個字段集和FormAction保存按鈕的窗體。一切都像銀條一樣直線前進。保存功能只能記住最大500個數據數組。有什麼地方可以增加限制嗎?儘管頁面可以呈現2000個文本字段。Silverstripe - FieldSet和FormAction限制?增加限制?

<?php 
    class ESM_Test extends Form { 
    public $jsValidationIncluded = false; 

    public function __construct($controller, $name, $systemId = null) { 
     $fields = new FieldSet(); 
     //push 2000 text field into fieldset 
     for ($i = 0; $i <2000; $i++) { 
      $fields->push(new TextField('Test_'.$i,'Test_'.$i, $i)); 
     } 
     $actions = new FieldSet(); 
     $saveButton = new FormAction('doSave', 'Save'); 
     $actions->push($saveButton); 
     parent::__construct($controller, $name, $fields, $actions); 
     $this->unsetValidator(); 
    } 

    public function doSave($data, $form) { 
     var_dump($data); //I only get to 500 data array instead of 2000 data array 
    } 
} 
+1

有一個像「max post vars」之類的PHP設置。您可能需要增加它。 –

回答

2

我在php.ini中將max_input_vars增加到2000,它工作!謝謝Robbie Averill