Closed mateusmcordeiro closed 6 years ago
Hi,
That's the normal behaviour of Luthier-CI; the controller will run after the middleware unless you stop the script execution explicitly. You can use the die()
or exit()
function inside your middleware to archieve that (return
statement will not work)
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Test_middleware
{
/**
* Middleware entry point
*
* @return void
*/
public function run()
{
/* YOUR CODE */
exit;
}
}
Refer to Middleware execution points topic for more information.
Cheers.
Hi First of all, I wanna thank you for my last issue. Now, im facing a problem with my controllers functions, in other words, I'm using the middleware, but my controller is still using its functions. This is a problem, because I need the middleware stop that exec.