Symfony2 FOSUserBundle 在 twig 模板中显示 expiresAt
Symfony2 FOSUserBundle Display expiresAt in twig template
我想在我的树枝中显示 expiresAt,但出现此错误:
Method "expiresat" for object "AuthenticationBundle\Entity\User" does not exist in AdminNCBundle:NC:list_clients.html.twig at line 43
我在我的树枝上做了一个 for :
{% for client in clients %}
<tr>
<td>{{ client.firstname }} {{ client.lastname }}</td>
<td>{{ client.telephone }}</td>
<td>{{ client.registrationdate|date('Y-m-d H:i:s') }}</td>
<td>{{ client.expiresat|date('Y-m-d H:i:s') }}</td>
<td>{{ client.duration }}</td>
</tr>
{% endfor %}
注册日期显示的很好
是正确的
我在我的 User
实体中添加了一个方法
public function getExpiresAt() {
return $this->expiresAt;
}
因为 FOSUserBundle 模型用户没有 getExpiresAt
方法
我想在我的树枝中显示 expiresAt,但出现此错误:
Method "expiresat" for object "AuthenticationBundle\Entity\User" does not exist in AdminNCBundle:NC:list_clients.html.twig at line 43
我在我的树枝上做了一个 for :
{% for client in clients %}
<tr>
<td>{{ client.firstname }} {{ client.lastname }}</td>
<td>{{ client.telephone }}</td>
<td>{{ client.registrationdate|date('Y-m-d H:i:s') }}</td>
<td>{{ client.expiresat|date('Y-m-d H:i:s') }}</td>
<td>{{ client.duration }}</td>
</tr>
{% endfor %}
注册日期显示的很好
我在我的 User
实体中添加了一个方法
public function getExpiresAt() {
return $this->expiresAt;
}
因为 FOSUserBundle 模型用户没有 getExpiresAt
方法