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

Controller求助

[复制链接]
发表于 2008-6-15 10:32:53 | 显示全部楼层 |阅读模式
发到官方,老外不太明白我意思
特来此求助

My site’s navigation like this

admin
        A
            A1
            A2
                 A2A
                 A2B
            A3
        B
            B1
            B2
        C
        D


all of A, A1 A2A are function and with parameters
How design Controller?
Solution 1:
THE PROBLEM IS How can I design A2A function ?
“application/controller/admin.php”

class Admin extends Controller {

   
function __construct() {
         parent
::Controller();
   
}

   
function index() {
        
// this is admin
   
}

   
function A($action = '', $page = 1) {
        
// this is A
        // example uri : admin/A/do/2/
        // how can I design A2A function ?
   
}

   
function B($page = 1, $action = 'testB') {
        
// this is B
        // example uri : admin/B/3/testB/
   
}
}


Solution 2:
if I create “admin” folder in “application/controller/”
so the struct is
admin/A.php
admin/B.php
admin/C.php
...
and create A class
THE PROBLEM IS how can I set the admin default controller? admin is a dir

A.php

class A extends Controller {

   
function __construct() {
         parent
::Controller();
   
}

   
function index() {
    }

   
function A1($action = '', $page = 1)

   
}

[ 本帖最后由 vps4 于 2008-6-15 10:41 编辑 ]
发表于 2008-6-15 20:45:07 | 显示全部楼层
-___-
地球人都看不懂,哈哈哈哈

我感觉是不是想三层目录?
ci好像就支持两层

如果想要url看上去像三层的话
可以配置url解析到特定的controller上去,至少外面看上去是三层的

本版积分规则