0
I want to make an active menu shape stay colored, so I separated my template has:
View: Menu_lateral.php - place where you have the side menu;
Controller: General: Where would I tell which menu is active;
In the view I did:
<?php
$ativo = array();
$ativo[0] = "";
$ativo[$current] = 'class="active"';
?>
And
<li class="nav-item <?php echo $ativo[0];?> ">
Already on the controller:
$this->load->view('dashboard/template/menu_lateral', $current = 0);
But get back to me:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: current
Filename: template/menu_lateral.php
Line Number: 5
Backtrace:
File: C:\xampp\htdocs\teste\application\views\dashboard\template\menu_lateral.php
Line: 5
Function: _error_handler
File: C:\xampp\htdocs\teste\application\controllers\Geral.php
Line: 10
Function: view
I believe I’m not correctly loading/calling the variable.