Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Dostęp do metody
trifek
post 25.09.2018, 14:46:12
Post #1





Grupa: Zarejestrowani
Postów: 340
Pomógł: 0
Dołączył: 28.09.2015

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


Witam,
Mam taki kod:

  1.  
  2. final class EnumClass extends Enum
  3. {
  4. protected const ERROR_STATUS = 'kod html [[X]] error';
  5. protected const WARNING_STATUS = 'kod html [[X]] warning error';
  6. protected const SUCCESS_STATUS = 'kod html [[X]] success error';
  7. }


Enum - jest klasą abstrakcyjną

chciałbym pobrać te dane:
  1. $html = EnumClass::${$messageType}


i otrzymuję komunikat: Uncaught exception: 'Error' with message 'Access to undeclared static property.

W jaki sposób poprawnie to zapisać?






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: 19.07.2025 - 04:19