-
-
Save parzibyte/6228c596d0501dd0cd33d49d36aec4e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class usuarios extends MY_Controller # Extender de MY_Controller, no CI_Controller | |
{ | |
public function __construct() | |
{ | |
// Aquí el código normal que tendrías... | |
parent::__construct(); | |
$this->load->model("usuariosModel"); | |
} | |
// Ojo aquí: debes regresar un arreglo de middlewares que quieres aplicar | |
// a este controlador. | |
protected function middleware() | |
{ | |
return ['Sesion']; | |
} | |
//================== | |
//Aquí tus otras funciones | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment