如何在Codeigniter中仅为特定方法禁用构造函数?

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?

Try this,

public function __construct(){
  parent::__construct();
  $method = $this->router->fetch_method();  

  if(empty($method ) && $method != 'get_public_pages'){
    if(empty($_SESSION['userid'])){
        $error['error'][] = "Please LogIn";
        echo json_encode($error);
        exit;
    }
 }  
}