Welcome Guest, Not a member yet? Register   Sign In
Can't extend class
#1

[eluser]mariusphp[/eluser]
Hi All,

I am an absolute beginner w/ CodeIgniter and PHP in general. Anyway, I have downloaded CodeIgniter v2.0.0 and I have attempted to extend the "CI_Pagination" class using the MY_Pagination class described here.

Basically, here is my scenario:

I have a file name called "MY_Pagination.php" that is located in application/libraries.

In my controller, I do this:

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

I have noted that the constructor of the MY_Pagination class DOES NOT get called. In other words, the framework has no idea that I have extended the CI_Pagination class described in the file "Pagination.php" located in system/libraries. The constructor of the CI_Pagination gets called and the framework thinks that I am using the CI_Pagination class rather than MY_Pagination since it gives me an error about a variable only defined in MY_Pagination. It basically says: CI_Pagination::$variable-name not found, where $variable-name is defined in MY_Pagination.

I have "installed" (basically, copied) CodeIgniter to an "App" sub-folder on my server.

I have modified the config.php file to reflect this situation like this:

Code:
$config['base_url']    = 'localhost/App/';

It is really frustrating as I don't understand why CodeIgniter can't see that there is an extended class available.

Also, logging does not work at all.

I have modified the config.php this way:

Code:
$config['log_threshold'] = 4;

However, NO messages are recorded in my application/log folder even though they are displayed in my browser. I have made sure that this folder and its parents, for that matter, have write permissions (777)...

I have tested some of the CodeIgniter's functionality by retrieving records from a database and passing them to a view. Everything works correctly so CodeIgniter must be installed correctly.

Thanks for any advice!
#2

[eluser]mariusphp[/eluser]
I fixed it. However, still don't know why logging doesn't work. Thanks.
#3

[eluser]mariusphp[/eluser]
Fixed logging too. Thanks.
#4

[eluser]InsiteFX[/eluser]
Well share how you fixed to the Community, so that other may learn!

InsiteFX
#5

[eluser]mariusphp[/eluser]
Hi InsiteFX,

I have re-copied all the framework to my server. Maybe there was some problem w/ my initial copy of CodeIgniter [unattended copy, who knows what may have happened].

As far as logging, the problem wasn't related to CodeIgniter. Turns out that my FTP client didn't see newly created files (even if I would navigate away from the log folder and back in). I actually had to disconnect and reconnect again to see the new log file that was indeed, created.

Marius




Theme © iAndrew 2016 - Forum software by © MyBB