我正在创建一个自定义字段来创建一个输入图像数组作为媒体类型。
如何带回类型为 media 的输入数组?
class JFormFieldimglist extends JFormField {
//The field class must know its own type through the variable $type.
protected $type = 'imglist';
public function getLabel() {
return "List Image";
}
public function getInput() {
for ($i = 1; $i <= 10; $i++) {
$images.= '<input type="text" value="'.$this->value[$i].'" name="'.$this->name.'['.$i.']" />';
}
return $images;
}
}
从 xml 我用这个
<field name = "myimage" type = "media" directory = "stories" />