[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