[eluser]tfliam[/eluser]
Hi, I'm building a large website and there's a lot of similar coding in many controllers, how could I put them in a separate file for code reusing?
For eg in my system/application/controllers/home.php, I have
Code:
<?php
class Home extends Controller {
function Home() {parent::Controller();}
function index()
{
$array_controller = $this->web_controller->get_web_controller_by_controller('home');
//CODE << CONTAINS OVER 20 LINES OF SIMILAR CODING
}
}
?>
and then in many other files, I'll have similar coding for eg. in my system/application/controllers/article/article_submit.php, I have
Quote:<?php
class Article_Submit extends Controller {
function Article_submit() {parent::Controller();}
function index()
{
$array_controller = $this->web_controller->get_web_controller_by_controller('article_submit');
//CODE << CONTAINS OVER 20 LINES OF SIMILAR CODING
}
}
?>