Jump to content

Interfaces not being found


PC Nerd

Recommended Posts

Hi,

 

I'm writing a sort of plugin system, and my Page ( as in the page specific class that handles that pages content) is telling me that it cannot find the interface which i included on the first line of index.php... any suggestions?

 

Thanks in advace - heres my code.

PC_Nerd

 

 

Error

Interface 'Page' not found in ******/cp/pages/Home.class.php on line 2

 

index.php:

<?php
include_once "classes/Page.ifc.php"; // Extension page interface
include_once "classes/Factory.class.php"; // Component Factory
include_once "classes/Filesystem.class.php"; //Filesystem management
$f= new Factory();

..... Other code that parses $_GET and $_POST... no implementation/use of any included files classes or anything etc.

$loaded = $f->loadClass("Home");
if($loaded==False) {
    die("Could not load Home");
}

$HomePage = new Home();

echo $HomePage->getPage();
?>

 

I wont post all my classes - they sort of "embed" each other inside the factory class - but essentially it searches subdireectoriese for teh named class - and then require_once's it.

 

Home.class.php

<?php 
class Home implements Page { 
    private $title = "Test page"; 
    private $content = "This is some test content.  Later it will be returned through the getPage() method";
......... *other methods based in the Page interface
}
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/148055-interfaces-not-being-found/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.