Codeigniter中的路由是什么?我不明白。
class teacher extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('teacher_model');
}
答案 0 :(得分:0)
路由规则在application / config / routes.php文件中定义。
Few Example :
1.Here are a few routing examples:
$route['journals'] = "blogs";
2.A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.
$route['blog/joe'] = "blogs/users/34";
For more Detail click Check Office Codeigniter User-guide (ellislab.com).
link:-https://ellislab.com/
答案 1 :(得分:0)
使用路线映射不是强制性的。您可以通过http://www.example.tld/controller_name/method_name/arg1/arg2
覆盖想要的页面。 route.php文件的主要目的是设置默认控制器。您可以在CodeIgniter中阅读docs about routing,还可以查看APPPATH . 'config/routes.php'
文件中的所有commented text。