DiverseYouthNightSchool/application/admin/manystore_command/Crud/stubs/mixins/checkbox.stub

8 lines
319 B
Plaintext
Raw Normal View History

2024-11-04 15:00:20 +08:00
public function {%methodName%}($value, $data)
{
$value = $value ? $value : (isset($data['{%field%}']) ? $data['{%field%}'] : '');
$valueArr = explode(',', $value);
$list = $this->{%listMethodName%}();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}