Mam problem z pobraniem w templatce Twig danych teleadresowych zalogowanego uzytkownika:

Login wyswietlam bez problemu w ponizszy sposob:
  1. {{ app.user.username }}


Natomiast nie wiem w jaki sposob wyswietlic dane z encji User w postaci: imienia, nazwiska itd.
Dostaje wartosc NULL, a probuje w ten sposob:
  1. {{ app.user.name }}



Moja encja User:
  1. class User extends BaseUser
  2. {
  3. /**
  4. * @ORM\Id
  5. * @ORM\Column(type="integer")
  6. * @ORM\GeneratedValue(strategy="AUTO")
  7. */
  8. protected $id;
  9.  
  10. /**
  11.   * @var string
  12.   *
  13.   * @ORM\Column(name="name", type="string", length=50, nullable=false)
  14.   */
  15. private $name;
  16.  
  17. /**
  18.   * @var string
  19.   *
  20.   * @ORM\Column(name="surname", type="string", length=50, nullable=false)
  21.   */
  22. private $surname;
  23. ...
  24. /**
  25.   * Set name
  26.   *
  27.   * @param string $name
  28.   *
  29.   * @return User
  30.   */
  31. public function setName($name)
  32. {
  33. $this->name = $name;
  34.  
  35. return $this;
  36. }
  37.  
  38. /**
  39.   * Get name
  40.   *
  41.   * @return string
  42.   */
  43. public function getName()
  44. {
  45. return $this->name;
  46. }
  47.  
  48. /**
  49.   * Set surname
  50.   *
  51.   * @param string $surname
  52.   *
  53.   * @return User
  54.   */
  55. public function setSurname($surname)
  56. {
  57. $this->surname = $surname;
  58.  
  59. return $this;
  60. }
  61.  
  62. /**
  63.   * Get surname
  64.   *
  65.   * @return string
  66.   */
  67. public function getSurname()
  68. {
  69. return $this->surname;
  70. }
  71. ...



Prosze o pomoc.