如何在Sonata Admin Bundle中的媒体字段中制作预览图像?
this-> https://symfony.com/doc/master/bundles/sonataadminbundle/cookbook/recipe_image_previews.html不工作返回
试图调用一个名为" getWebpath"类的未定义方法...
您必须在实体图像类中实现getWebPath方法(查看前提条件),例如:
protected function getUploadDir()
{
return '/uploads';
}
public function getWebPath()
{
return null === $this->path
? 'null'
: $this->getUploadDir().'/'.$this->path;
}