Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]include - nie dodaje klasy
finito
post
Post #1





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 16.12.2012

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


Napisałem maleńką klasę o takim kodzie:
  1. class set{
  2. static $deff;
  3. static function deff($option){
  4. if( isset(self::$deff[ $option ]) ){
  5. return self::$deff[ $option ];
  6. }else{
  7.  
  8. return null;
  9. }
  10. }
  11. };

Plik z klasą nazwałem set.class.php i usiłuję ją załączyć do pliku index:
  1. <?php include 'set.class.php';?>
  2. <?php $string = set::deff('jakis string');?>
  3. <?php echo $string; var_dump($string); ?>

Czemu po wpisaniu set:: nie mam dostępu do deff, skoro dałem include?
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: 25.08.2025 - 14:28