Welcome Guest, Not a member yet? Register   Sign In
Controller structure
#1

[eluser]vps4[/eluser]
My site's navigation like this

Code:
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"
Code:
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. And I don't like to modify route config file.

A.php

Code:
class A extends Controller {

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

    function index() {
    }

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

    }


Messages In This Thread
Controller structure - by El Forum - 06-14-2008, 07:36 PM
Controller structure - by El Forum - 06-14-2008, 08:17 PM
Controller structure - by El Forum - 06-14-2008, 08:48 PM
Controller structure - by El Forum - 06-14-2008, 08:50 PM
Controller structure - by El Forum - 06-15-2008, 01:22 AM
Controller structure - by El Forum - 06-15-2008, 01:40 AM
Controller structure - by El Forum - 06-16-2008, 02:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB