Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> prosta klasa....
boosik01
post
Post #1





Grupa: Zarejestrowani
Postów: 91
Pomógł: 1
Dołączył: 19.08.2009

Ostrzeżenie: (10%)
X----


Cześć. Mam problem z prostą klasą, z OOP mało mam do czynienia, lecz staram się jakoś to ogarnąć ;-) Siedzę nad jednym probleme z dobre 2h i niestety nic nie wykombinowałem... A mianowicie nie chce mi zwrócić błędu, kod:

klasa:
  1. <?php
  2. class validate
  3. {
  4.  
  5. public $error = NULL ;
  6.  
  7. public function __construct()
  8. {
  9. $this->error = $error ;
  10. }
  11.  
  12. public function disable($disable)
  13. {
  14. if($disable == true)
  15. {
  16. $this->error = ' aa ' ;
  17. }
  18. }
  19.  
  20. public function dis()
  21. {
  22. return $this->error ;
  23. }
  24.  
  25. }


Plik php:

  1. $check_mess = new validate ;
  2. $check_mess->disable(true) ;
  3. echo $check_mess->dis() ;
Go to the top of the page
+Quote Post

Posty w temacie
- boosik01   prosta klasa....   10.08.2012, 19:51:36
- - redeemer   U mnie wykonuje się poprawnie. Poza tym w konstruk...   10.08.2012, 19:55:38


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 Aktualny czas: 21.08.2025 - 21:12