我创建了一个自定义组件,在管理表单中,我有一个字段可以选择照片。
在administrator/models/forms/example.xml
我可以定义字段:
<field name="photo" type="media"
label="COM_EXAMPLE_FORM_LBL_PHOTO"
description="COM_EXAMPLE_FORM_DESC_PHOTO"
filter="raw"
directory="/images/example/photos"
/>
问题:
当我按下选择按钮时,媒体管理器的目录设置为/images
。
我试过directory="JPATH_ROOT/images/example/photos"
->同样的结果。
如何设置directory
媒体管理器才能打开/images/example/photos
?
试试这个:
<field name="photo" type="media"
label="COM_EXAMPLE_FORM_LBL_PHOTO"
description="COM_EXAMPLE_FORM_DESC_PHOTO"
filter="raw"
directory="example/photos"
/>
注意:我只用了 example/photos
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句