Php 在configureFormFields中预览sonata媒体包中的图像
如何在sonata管理包的媒体字段中制作预览图像 这个->没有工作 返回 试图调用类的名为“getWebPath”的未定义方法Php 在configureFormFields中预览sonata媒体包中的图像,php,symfony,sonata-admin,sonata,Php,Symfony,Sonata Admin,Sonata,如何在sonata管理包的媒体字段中制作预览图像 这个->没有工作 返回 试图调用类的名为“getWebPath”的未定义方法 您必须在实体图像类(查看)中实现getWebPath方法,类似于: protected function getUploadDir() { return '/uploads'; } public function getWebPath() { return null === $this->path ? 'null'
您必须在实体图像类(查看)中实现getWebPath方法,类似于:
protected function getUploadDir()
{
return '/uploads';
}
public function getWebPath()
{
return null === $this->path
? 'null'
: $this->getUploadDir().'/'.$this->path;
}
请在问题正文中包含所有相关信息。这不仅使我们更容易提供帮助,而且还确保了如果链接无效,该问题对所有访问者仍然有效,并且帖子可能会被删除。谢谢