Symfony plugin sfDoctrineActAsTaggablePlugin not working

前端 未结 3 1830
-上瘾入骨i
-上瘾入骨i 2021-01-26 09:26

I want to attribute some tags to some of the objects of my doctrine model.

I found sfDoctrineActAsTaggablePlugin which seems to be precisely what I need.

The pro

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-26 09:37

    Possible Issues:

    Make sure you have the plugin enabled

    In ProjectConfiguration::setup, you should have

    $this->enablePlugins(array(
      'sfDoctrineActAsCommentablePlugin', //plus other plugins, like Doctrine
    ));
    

    Set Up Your Schema Correctly

    It should look like this:

    ModelClass:
      actAs:
        Taggable:
      columns: //etc
    

    You should be using actAs not templates.

    I don't believe you need to set an explicit relations for Tags, but I could be wrong about that. If you let me know, I will edit this answer.

提交回复
热议问题