我有一個設計的模板上從客戶端的Photoshop。我的審訊......當我看到模板是:我可以並排放置兩個字段嗎?我想在一行上有f_firstname和f_lastname ...是否有注入標籤或代碼片段類如ex:div =「column1of2」 $ field_here close div有2列2個字段?Silverstripe更好的形式在模板上尋找
實際上,代碼生成每個字段都在分隔行上。這不是很漂亮。可能?
我有這樣的代碼:
private static $allowed_actions = array(
'FormInfolettre'
);
public function FormInfolettre() {
$fields = new FieldList(
EmailField::create('f_email', 'Votre courriel'),
TextField::create('f_firstname', 'Votre prénom'),
TextField::create('f_lastname', 'Votre nom'),
TextField::create('f_message', 'Votremessage'),
);
$actions = new FieldList(
FormAction::create("Soumettre")->setTitle("Soumettre")
);
$required = new RequiredFields(
array(
'f_email',
'f_firstname',
'f_lastname',
'f_message',
));
$form = new Form($this, 'FormInfolettre', $fields, $actions, $required);
return $form;
}
謝謝@wmk!這很好用! – StefGuev
@NewbieSSProgrammer感謝您修復我的答案中的錯誤;) – wmk
沒問題!你幫我,我會幫你;) – StefGuev