Welcome Guest, Not a member yet? Register   Sign In
Extend library with own class
#3

[eluser]Hyra[/eluser]
Thanks for your reply. I'm familiar with libraries and where to put them.

The problem however is extending them with other custom libraries.

Let me try again to display the problem.

In:
/system/application/libraries
I want to have a file:
MY_Reward.php

Code:
class MY_Reward {
    function test() {
        echo "This is the 'mother class'";
    }
};

In the same folder I want another file:
CustomReward.php

Code:
class CustomReward extends MY_Reward {
     function __construct() {
         $this->test();
     }
     // other custom functions
};

In one of the controllers:

Code:
$this->load->library('CustomReward');

The system fails upon extending the CustomReward library with the MY_Reward class. No error message, just a blank page.

I'm wondering why, and if there's any way to get around doing this.


Messages In This Thread
Extend library with own class - by El Forum - 10-12-2009, 03:31 AM
Extend library with own class - by El Forum - 10-12-2009, 03:50 AM
Extend library with own class - by El Forum - 10-12-2009, 03:55 AM
Extend library with own class - by El Forum - 10-12-2009, 04:04 AM
Extend library with own class - by El Forum - 10-12-2009, 04:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB