1

我正在尝试为 Hauleook/AliceBundle 夹具配置 yml 文件。

Project\MainBundle\Entity\Manager:
   manager_{1..30}:
      name: '<firstName()> <lastName()>'
      profile_image: '9.jpg'
      profile_image_thumb: '<randomElement(['9.jpg','10.jpg'])'

当我尝试运行时,我收到以下错误消息

bin/console hautelook:fixtures:load

  [Nelmio\Alice\Exception\FixtureBuilder\ExpressionLanguage\LexException]  
  Could not lex the value "["10.jpg"".    
4

1 回答 1

0

好像你用的是3.0.0.beta版,能降级到稳定版吗?

在 2.2.2 中,此语法适用于我:

'<randomElement( ["1", "2"] )>'
于 2016-12-07T09:04:24.143 回答