I want to make a form of the active menu stay colorful, so I separated my template has:
View: Menu_lateral.php - place where the side menu is;
Controller: General: Where would I tell which menu is active;
In the view I did:
<?php
$ativo = array();
$ativo[0] = "";
$ativo[$current] = 'class="active"';
?>
E
<li class="nav-item <?php echo $ativo[0];?> ">
Already in the controller:
$this->load->view('dashboard/template/menu_lateral', $current = 0);
But it returns 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 that I am not loading correctly / correctly calling the variable.