2016-10-24 46 views
0

在本地主機萬事都很好,但我已經部署了個項目後,我得到這個錯誤註釋「@Gedmo彈頭不存在,或無法被自動裝載

[Semantical Error] The annotation "@Gedmo\Mapping\Annotation\slug" in property 
AppBundle\Entity\Product::$slug does not exist, or could not be auto-loaded. 

這是類產品

use Gedmo\Mapping\Annotation as Gedmo; 
abstract class Prodcut 
{ 
/** 
* @var int 
* 
* @ORM\Column(name="id", type="integer") 
* @ORM\Id 
* @ORM\GeneratedValue(strategy="AUTO") 
*/ 
protected $id; 

/** 
* @var string 
* 
* @ORM\Column(name="name", type="string", length=255) 
*/ 
private $name; 

/** 
* @var string 
* @Gedmo\slug(fields={"name"}) 
* @ORM\Column(name="slug", type="string", length=255, unique=true) 
*/ 
private $slug; 

回答

4

那是因爲你的註釋中定義別名:

use Gedmo\Mapping\Annotation as Gedmo; 

,然後用它作爲@Gedmo\slug(fields={"name"})其插值到:

@Gedmo\Mapping\Annotation\slug(fields={"name"}) 

正確名稱是資本S

@Gedmo\Slug(fields={"name"}) 
相關問題