用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1314|回复: 2
收起左侧

[已解决] 进阶的问题?看看有神级的人物能破解的吗

[复制链接]
发表于 2014-11-5 10:50:35 | 显示全部楼层 |阅读模式
在不更改system系统为前提下

怎么能让 Welcome 集成自定义前缀 Os  达到 class Welcome extends Os_Controller
PHP复制代码
 
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Welcome extends Os_Controller {
 
    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     *         http://example.com/index.php/welcome
     *    - or -  
     *         http://example.com/index.php/welcome/index
     *    - or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */

    public function index()
    {
        $this->load->view('welcome_message');
    }
}
 
复制代码

 楼主| 发表于 2014-11-5 11:01:26 | 显示全部楼层
自己给自己结了 在core里面写就行了
发表于 2014-11-5 12:24:23 | 显示全部楼层
这个可以先写一个类,继承 CI_Controller 然后在 config.php 里修改前缀,就可以了,不用修改源码。

在 CI 里基本没有需要修改源码才能实现的功能,至少目前我还没遇到。。。。

本版积分规则