I have more than 30 methods in this User Controller.I don't want to create another controller just for this single method.
class User extends CI_Controller {
public function __construct()
{
parent::__construct();
if(empty($_SESSION['userid'])){
$error['error'][] = "Please LogIn";
echo json_encode($error);
exit;
}
}
public function index(){
}
public function get_public_pages(){
}
}
I don't want the constructor function to run when accessing get_public_pages method.How can I do it?