php - Why construct function creates issue in codeigniter 3? -
i new codeigniter 3.x, in codeigniter 3.x when write
class auth extends ci_controller { public function __construct() { parent::__construct(); echo "ya"; } }
it shows me error
404 page not found page requested not found.
and when write
class auth extends ci_controller { public function __construct() { parent::__construct(); echo "ya"; } public function index() { echo "aya";exit; } }
it works fine , shows output {yaaya}. can let me know y this?
the reason behind when run url
by default index()
of controller
if use url like
it function of controller
and if not written function in controller __construct
function __construct() { parent::__construct(); }
it means no index() function show 400 error
Comments
Post a Comment