Daniel García
Daniel García

Reputation: 379

How can i use extends correctly? php

Summary.php

<?php namespace interfaces\summary;

use \interfaces\id\id;

class Summary extends \interfaces\id { // This is line 7
 // ... code
}

id.php

<?php namespace interfaces\id;

class id {
 // ... code
}


Fatal error: Class 'interfaces\Id' not found in H:\ngnx\nginx-1.9.9\html\server\interfaces\userSummary.php on line 7

I don't know what is the error there. i need to include the file? (both files are in the same folder)

Upvotes: 1

Views: 41

Answers (1)

jbafford
jbafford

Reputation: 5668

Your class id is in the namespace interfaces\id. This means that its full name is \interfaces\id\id.

You will want to changes your extends line to either:

class Summary extends \interfaces\id\id

or, because you already have the use \interfaces\id\id statement the line before,

class Summary extends id

Upvotes: 1

Related Questions