Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> funkcja include i require
RedDoom
post 12.06.2010, 12:44:31
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 12.06.2010

Ostrzeżenie: (0%)
-----


Mam problem z tymi funkcjami.

Mam plik 'Draw.inc'
  1. <?php
  2. class Location {
  3. public $Left;
  4. public $Top;
  5. public function __construct() {
  6. $this->Top=0;
  7. $this->Left=0;
  8. }
  9. ?>


Nastepny plik 'control.inc'
  1. <?php
  2. include ('Draw.inc')
  3. class Draw {
  4. public $Location;
  5. public function __construct() {
  6. $this->Location=new Location;
  7. }
  8. ?>


i plik ktory uruchamiam 'test.php'
  1. <?PHP
  2. include('control.inc')
  3. $D=new Draw;
  4. $D->Location->Top=5;
  5. ?>

i otrzymuje taki komunikat
Fatal error: Class 'Location' not found in control.inc on line ...
czy ktos mi moze wytlumaczyc co robie zle
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 12.07.2025 - 19:20