title: CAKEPHP- Database based navigation on every page
body: <p>i´m new in CakePHP so apologize me, if it is a stupid question.</p>
  
  <p>I´m trying to show dynamic navbar based on database. I´ve created a working Model/Controller/View setup based on database. But now i want to show the navbar on every page. </p>
  
  <p>Is there a way to import "view into view" ? </p>
  
  <p>My code: [view]</p>
  
  <pre><code>&lt;div class="collapse navbar-collapse" id="collapsibleNavbar"&gt;
  &lt;ul class="navbar-nav ml-auto"&gt;  
  &lt;?php 
  $dropend = false;
  foreach ($Navbar as $navlink) 
      {
          if($navlink-&gt;parent_id == 0)
          {
              if($navlink-&gt;rght - $navlink-&gt;lft == 1){
                  echo'
      &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="#"&gt;'.$navlink-&gt;name.'&lt;/a&gt;&lt;/li&gt;';
              } else {
                  echo'
      &lt;li class="nav-item dropdown"&gt;
          &lt;a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown"&gt;'.$navlink-&gt;name.'&lt;/a&gt;
          &lt;div class="dropdown-menu"&gt;';
                  $dropend = $navlink-&gt;rght;
              }
          } else {
              if($navlink-&gt;rght + 1 == $dropend){
                  echo'
              &lt;a class="dropdown-item" href="#"&gt;'.$navlink-&gt;name.'&lt;/a&gt;
          &lt;/div&gt;
      &lt;/li&gt;';
              } else {
                  echo'
              &lt;a class="dropdown-item" href="#"&gt;'.$navlink-&gt;name.'&lt;/a&gt;';
              }
          }
      }
  ?&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p>[Pages/home]</p>
  
  <pre><code>use Cake\Cache\Cache;
  use Cake\Core\Plugin;
  use Cake\Datasource\ConnectionManager;
  use Cake\Error\Debugger;
  use Cake\Http\Exception\NotFoundException;
  
  $this-&gt;layout = "page";
  ?&gt;
  -------------------------navbar location------------------
      &lt;div class="banner banner-main" style="background-image:url('&lt;?php echo $this-&gt;Url-&gt;image('banner/1.jpg'); ?&gt;')"&gt;
              &lt;div class="container"&gt;........
  </code></pre>