Welcome Guest, Not a member yet? Register   Sign In
more than one controller
#1

[eluser]vinod_ci[/eluser]
Hi
I have to create more than one cotrollers.
Because currently, In my controller the code size is beyound 4000 lines.
How i put this number of functions in seperate files and again make call from main controller to this functions.

I have tried one solution for this, the files are:

1. made one base controller
/application/libraries/

class MY_Controller extends Controller {

function MY_Controller() {
parent::Controller();
}
function test_vinod($xyz)
{
echo “hi hello”;
echo $xyz;
}

}
2. for developer1

/application/libraries/

<?php

class devloper1 extends MY_Controller {

function devloper1() {
parent::MY_Controller();

}
function homepage()
{
echo “vinod”;
}
}

same as above i want to create more classes like developer2.....3,4,5
In which developer put his own functions

3. And finally my base controller from which i can call these functions from developers

<?php

class Welcome extends MY_Controller {

function Welcome()
{
parent::MY_Controller();


}

function index()
{
$this->test_vinod(’abc’);

$this->load->library(’devloper1’);
$this->devloper1->homepage();
// likely above statement can i load more libraries (developers)
// and call the functions
}

}

My question: is it way to make compact and clear code?

Thanks


Messages In This Thread
more than one controller - by El Forum - 08-11-2008, 03:46 AM
more than one controller - by El Forum - 08-21-2008, 09:47 AM
more than one controller - by El Forum - 08-21-2008, 11:32 PM
more than one controller - by El Forum - 08-22-2008, 01:14 AM
more than one controller - by El Forum - 08-22-2008, 01:25 AM
more than one controller - by El Forum - 08-22-2008, 01:40 AM
more than one controller - by El Forum - 08-22-2008, 01:54 AM
more than one controller - by El Forum - 08-22-2008, 02:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB