Silverstripe - FieldSet和FormAction限制?增加限制?
问题描述:
我们使用银条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
}
}
答
我在php.ini中将max_input_vars增加到2000,它工作!谢谢Robbie Averill
有一个像“max post vars”之类的PHP设置。您可能需要增加它。 –