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

SAE上 多级目录如何设置

[复制链接]
发表于 2013-4-11 21:47:33 | 显示全部楼层 |阅读模式
不在SAE上,可以在application/core目录下写一个MY_Router.php,就可以实现多级目录的访问
不知道在SAE上如何进行设置,求帮助

 楼主| 发表于 2013-4-11 21:56:45 | 显示全部楼层
补一句:用SAE,config.php,autoload.php是不是就不能设置了呢?
 楼主| 发表于 2013-4-11 22:35:26 | 显示全部楼层
修改了MY_Router.php文件名,改为SAE_Router.php
运行程序,报如下错

Unable to locate the specified class: user_agent.php
发表于 2013-4-12 13:11:14 | 显示全部楼层
HappySteel-Cent 发表于 2013-4-11 21:56
补一句:用SAE,config.php,autoload.php是不是就不能设置了呢?

SAE上这些都能使用。
如果不能使用除非特殊情况,都应该是程序问题。
发表于 2013-4-12 13:13:04 | 显示全部楼层
HappySteel-Cent 发表于 2013-4-11 22:35
修改了MY_Router.php文件名,改为SAE_Router.php
运行程序,报如下错

这个应该是BUG,我先查查。
 楼主| 发表于 2013-4-12 14:22:53 | 显示全部楼层
是不是区分大小写啊,,,
之前我写的是:
class SAE_Router extends CI_Router {
        public function __construct()
        {
                 parent :: __construct();
                 $this->agent=load_class('user_agent');
        }
改为  User_agent,就不再报错
-------------------------------------------------------------------------------------------------------------------------------------
同样的问题还有,我在application/helpers/创建一个文件SAE_functions_helper.php
然后在autoload.php中加载   $autoload['helper'] = array("url","SAE_functions");
系统还是报错

An Error Was Encountered
Unable to load the requested file: helpers/sae_functions_helper.php
我将SAE出现的地方都改为小写,系统就不报错
 楼主| 发表于 2013-4-12 14:57:11 | 显示全部楼层
/application/
     controllers/
              test/
                    test.php

class Test extends CI_Controller{
        public function __construct()
        {
                parent::__construct();
        }
        public function index()
        {
               $data['test']= "测试文字";
                $this->load->view('welcome_log',$data);
         }
}
访问  http://www.example.com/index.php/test/test/index
提示
404 Page Not Found
The page you requested was not found
发表于 2013-4-12 15:20:57 | 显示全部楼层
HappySteel-Cent 发表于 2013-4-12 14:57
/application/
     controllers/
              test/

测试没有报错
http://codeigniter.sinaapp.com/index.php/test/test/index

不需要修改路由
 楼主| 发表于 2013-4-12 16:02:18 | 显示全部楼层
多谢版主提醒!问题解决了
发表于 2014-7-5 19:46:20 | 显示全部楼层
HappySteel-Cent 发表于 2013-4-12 16:02
多谢版主提醒!问题解决了

楼主还在么,请问如何解决了?

本版积分规则