dongzha3058 2011-11-23 06:07
浏览 18

塞满了symfony

I have a problem with slugs in symfony. I defined the slug fields with the last_name and first_name fields but when I load the fixtures, the slug for each fixture is created based on the title field of the table and not based on my defined fields. do you know why this could happen?

Faculty: 
  tableName: faculty
  inheritance: 
    extends: SvaGeneric 
    type: concrete 
  columns: 
    instructor_id: { type: string(20) } 
    first_name: { type: string(255), notnull: true } 
    last_name: { type: string(255), notnull: true } 
    title: { type: string(80) } 
  actAs: 
    Sluggable: 
      unique: true 
      fields: [last_name,first_name] 
      canUpdate: true
  • 写回答

1条回答 默认 最新

  • dow72046 2011-11-24 10:49
    关注

    Make sure your definition looks like:

    # config/doctrine/schema.yml
    JobeetCategory:
      actAs:
        Timestampable: ~
        Sluggable:
          fields: [name]
      columns:
        first_name:
          type: string(255)
          notnull:  true
        last_name: {type: string(255), notnull:true }
    

    So set the fields the right way:
    Sluggable: { fields: [first_name,last_name], }

    Maybe you check if you need "uniqueBy" or a custom behaviour for multi-column slugs.

    评论

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据