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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.