Browse Source

Afficher nom complet du user dans navbar

François 6 years ago
parent
commit
5e65b76c28

+ 1 - 1
app/Resources/views/base.html.twig

@@ -51,7 +51,7 @@
 					<ul class="navbar-nav">
 						<li class="nav-item dropdown">
 							<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-								{{ app.user.username }}
+								{{ app.user.nomComplet }}
 							</a>
 							<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
 								<a class="dropdown-item" href="{{ path('user_profil') }}">Profil</a>

+ 1 - 0
src/AppBundle/Controller/SecurityController.php

@@ -217,6 +217,7 @@ class SecurityController extends Controller
     }
 
     /**
+     * Ne pas utiliser
      * @Route("/admin/resettokens", name="admin_resettokens")
      */
     public function resetTokensAction()

+ 9 - 0
src/AppBundle/Entity/User.php

@@ -429,4 +429,13 @@ class User implements UserInterface
         return $this->filmsVus;
     }
 
+    /**
+     * Get nomComplet
+     * @return string
+     */
+    public function getNomComplet()
+    {
+        return $this->getPrenom()." ".$this->getNom();
+    }
+
 }