fix: 修复表单生成小细节
This commit is contained in:
@@ -394,12 +394,11 @@ class FormBuilder
|
|||||||
*/
|
*/
|
||||||
public function switch(array $data = []): string
|
public function switch(array $data = []): string
|
||||||
{
|
{
|
||||||
$value = $this->formtype ? '{$data.' . $data['name'] . '}' : '';
|
|
||||||
$param = '$data.' . $data['name'];
|
$param = '$data.' . $data['name'];
|
||||||
if ($this->formtype) {
|
if ($this->formtype) {
|
||||||
return <<<Eof
|
return <<<Eof
|
||||||
<input type="hidden" type="checkbox" name="{$data['name']}" value="0" />
|
<input type="hidden" type="checkbox" name="{$data['name']}" value="0" />
|
||||||
<input type="checkbox" name="{$data['name']}" value="$value" <eq name="{$param}" value="1" > checked </eq> lay-skin="switch" />
|
<input type="checkbox" name="{$data['name']}" value="1" <eq name="{$param}" value="1" > checked </eq> lay-skin="switch" />
|
||||||
Eof;
|
Eof;
|
||||||
}
|
}
|
||||||
return <<<Eof
|
return <<<Eof
|
||||||
|
|||||||
Reference in New Issue
Block a user