Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][OOP] extends
Spirit86
post
Post #1





Grupa: Zarejestrowani
Postów: 607
Pomógł: 23
Dołączył: 8.09.2004
Skąd: Wrocław

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


Witam. Napisałem klasę Modules i rozszerzam ją klasą Links.

  1. Class Modules{
  2.  
  3. function __construct(){
  4. $this->InicializeModules();
  5. }
  6. #...
  7. }
  8.  
  9. Class Links extends Modules{
  10.  
  11. function t(){
  12. echo '<a href="adads">asdas</a>';
  13. }
  14.  
  15. }

teraz wywołuję:

  1. $modules = new Modules();
  2. $modules->t();

efekt:
Kod
Fatal error: Call to undefined method Modules::t() in ... on line 49

dlaczego?(IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 3.10.2025 - 01:01