title: Login and Register links in Layout
body: <p>Could someone please explain how I can add <code>“Log in”</code> and <code>“Register”</code> links to my Layout, that change to <code>‘Log Out’</code> and <code>‘My Account’</code> links, once the user has logged in?</p>
  
  <p>I tried the following code, but it doesn’t work.</p>
  
  <pre><code>  {% if is_granted('ROLE_USER') %}
      &lt;a class="dark-grey-small bold" href="{{ path('sylius_shop_account_dashboard') }}"&gt;{{ 'sylius.ui.my_account'|trans }}&lt;/a&gt;
      &lt;a class="dark-grey-small bold" href="{{ path('sylius_shop_logout') }}"&gt;{{ 'sylius.ui.logout'|trans }}&lt;/a&gt;
    {% else %}
      &lt;a class="dark-grey-small bold" href="{{ path('sylius_shop_login') }}"&gt;{{ 'sylius.ui.login'|trans }}&lt;/a&gt;
      &lt;a class="dark-grey-small bold" href="{{ path('sylius_shop_register') }}"&gt;{{ 'sylius.ui.register'|trans }}&lt;/a&gt;
    {% endif %}
  </code></pre>
  
  <p>My homepage action is as follows:</p>
  
  <p>
  
  <pre><code>/*
   * This file is part of the Sylius package.
   *
   * (c) Paweł Jędrzejewski
   *
   * For the full copyright and license information, please view the LICENSE
   * file that was distributed with this source code.
   */
  
  declare(strict_types=1);
  
  namespace Sylius\Bundle\ShopBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\HttpFoundation\Response;
  
  final class HomepageController
  {
      /** @var EngineInterface */
      private $templatingEngine;
  
      public function __construct(EngineInterface $templatingEngine)
      {
          $this-&gt;templatingEngine = $templatingEngine;
      }
  
      public function indexAction(Request $request): Response
      {
          return $this-&gt;templatingEngine-&gt;renderResponse('@SyliusShop/Homepage/index.html.twig');
      }
  }
  </code></pre>