我需要这样的东西:
@if ($array.length > 0)
{{-- expr --}}
@endif
Run Code Online (Sandbox Code Playgroud)
这可能吗?
@if (count($array) > 0)
{{-- expr --}}
@endif
Run Code Online (Sandbox Code Playgroud) 我的项目中有2个包:
每个都有自己的数据库
实际上我的security.yml只有一个提供者:
providers:
korea:
entity: { class: Korea\AlmacenBundle\Entity\Usuario, property: username }
Run Code Online (Sandbox Code Playgroud)
如您所见,两个bundle都通过同一个表进行身份验证:Usuario,在korea_motos中
表:Usuario(korea_motos数据库)
----- ----- 1 | -------------管理---------------- | ------- --- AlmacenBundle ----------
----- ----- 2 | -------------管理---------------- | ------- --- RepuestosBundle -------
现在我想验证用户,对于RepuestosBundle,在galvez_motos中使用表Usuario,删除上一表中的"bundle"列.
问题出在security.yml文件中.如果我这样做:
providers:
korea:
entity: { class: Korea\AlmacenBundle\Entity\Usuario, property: username }
galvez:
entity: { class: Galvez\RepuestosBundle\Entity\Usuario, property: username }
Run Code Online (Sandbox Code Playgroud)
Symfony发布了一个例外:
The class 'Galvez\RepuestosBundle\Entity\Usuario' was not …Run Code Online (Sandbox Code Playgroud)