05-09-2009, 10:26 PM
|
#14 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Tanax
Well, that is because first of all, your Loader class does not have a function called loadClass. Secondly, in order to use Loader::loadClass you must either;
1. Declare the function loadClass as static like so:
PHP Code:
public static function loadClass($classToLoad)
2. Have the Loader class instanced somewhere before you call the function, which will allow you to call Loader:loadClass without having the loadClass function as static.
Also, your pagination class should not rely on Database in order to paginate.
|
Thanks, it seemed to work when included the file first in the header.html like this:
PHP Code:
<?php
include_once("includes/allclass.php"); Loader::loadClass();
?>
And in the allclass.php file:
PHP Code:
<?php
class Loader { public function loadClass() { include_once("database.php"); include_once("sessions.php"); include_once("login.php"); include_once("pagination.php"); include_once("member.php"); include_once("validation.php"); }
} ?>
So it is kinda interesting that I have to "include_once" the allclass.php file first, and then load it with the Loader function...kinda seems redundant don't you think?
As for the pagination file, I looked it over and it's the same class that I was working on awhile ago which DOES NOT need to use mySQL, it is DB independant, you can feed it an array. So that was my mistake sorry. I thought it needed mysql but it doesn't....
|
|
|
|