PHP Classes

Error

Recommend this page to a friend!

      Comment  >  All threads  >  Error  >  (Un) Subscribe thread alerts  
Subject:Error
Summary:Error in class_comment_admin.php
Messages:4
Author:Jon Ezrin
Date:2006-09-03 15:05:26
Update:2006-09-03 20:32:09
 

  1. Error   Reply   Report abuse  
Picture of Jon Ezrin Jon Ezrin - 2006-09-03 15:05:26
Fatal error: Class comment_admin: Cannot inherit from undefined class comment in class_comment_admin.php on line 18

  2. Re: Error   Reply   Report abuse  
Picture of Peter Klauer Peter Klauer - 2006-09-03 18:25:10 - In reply to message 1 from Jon Ezrin
Just include the comment class in the same page before the comment_admin class is included.
The comment_admin extends comment, but does not include it. This has some reasons but my english is not so well to describe my feelings about inherited classes that include other files.

  3. Re: Error   Reply   Report abuse  
Picture of Jon Ezrin Jon Ezrin - 2006-09-03 19:11:17 - In reply to message 2 from Peter Klauer
Can you give an example of what the page coding would look like?

  4. Re: Error   Reply   Report abuse  
Picture of Peter Klauer Peter Klauer - 2006-09-03 20:32:09 - In reply to message 3 from Jon Ezrin

include 'includes/class_comment.php'; // <-- comment_admin needs this one
include 'includes/class_comment_admin.php';

$comment_admin = new comment_admin($sqltable, 'css/'.$style.'/' );
$comment_admin->code_for = $admin_code_for;
$comment_admin->id_for = $admin_id_for;

...