I'm developing a site which I need to call a modal in the submenu of a bootstrap navbar, however, the file in php with the page I'd like to call is in a different folder than the navbar file. I searched a lot of sites and found a way that did not work, could anyone help me?
My navbar code:
public function get_menu() {
echo <<<HTML
<nav class="navbar my-nav navbar-expand-lg">
<a class="navbar-brand" href="#">Sistema</a>
<button class="navbar-toggler navbar-toggler-right custom-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Início <span class="sr-only">(current)</span></a>
</li>
<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">
Cadastrar</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item menu_item" href="#">Perfil</a>
<a class="dropdown-item menu_item" href="#">Usuário</a>
</li>
<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">
Consultar</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item menu_item" href="#">Perfil</a>
<a class="dropdown-item menu_item" href="#">Usuário</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Sair</a>
</li>
</ul>
</div>
</nav>
HTML;
}
Folder structure:
C: \ Project \ view \ main \ main_principal.php (file containing navbar, main screen) C: \ Project \ view \ modal \ index.php (file with modal)