Welcome Guest, Not a member yet? Register   Sign In
Checking if application is closed/open?
#2

[eluser]Grahack[/eluser]
You can create a base controller with common vars and functions. All your controllers will inherit from it.

In application/libraries/MY_Controller.php
Code:
<?php
Class MY_Controller extends Controller {

    var $common_var;
    
    function MY_Controller()
    {
        parent::Controller();
    }
    
    function mult( $n1, $n2 )
    {
        return $n1 * $n2;
    }
}

In application/controllers/product.php
Code:
<?php

class Product extends MY_Controller {

    function Product()
    {
        parent::MY_Controller();
    }
    // ...
    // here you can use $this->mult()
}

Have a try and keep us updated.


Messages In This Thread
Checking if application is closed/open? - by El Forum - 06-19-2008, 08:03 PM
Checking if application is closed/open? - by El Forum - 06-21-2008, 09:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB