Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 19, 2019 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/6228c596d0501dd0cd33d49d36aec4e6 to your computer and use it in GitHub Desktop.
Save parzibyte/6228c596d0501dd0cd33d49d36aec4e6 to your computer and use it in GitHub Desktop.
<?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