Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Smarty a w tym classa (błąd)
Zmorcia
post
Post #1





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

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


  1. <?
  2. class saveConcurs
  3. {
  4. public function saveArrays()
  5. {
  6. $this->saveName = $_POST['saveName'];
  7. $this->saveEmail = $_POST['saveEmail'];
  8. $this->savePhone = $_POST['savePhone'];
  9. $this->saveCode = $_POST['saveCode'];
  10.  
  11. smarty::assign('smartyName', $this->saveName);
  12. smarty::assign('smartyEmail', $this->saveEmail);
  13. smarty::assign('smartyPhone', $this->savePhone);
  14. smarty::assign('smartyCode', $this->saveCode);
  15. smarty::display('save.tpl');
  16. }
  17. }
  18.  
  19. $save = new saveConcurs;
  20. $save -> saveArrays();
  21. ?>


Popatrzcie jaki mam błąd:

Fatal error: Call to undefined method saveConcurs::fetch() in /home/accounts_c/chill/public_html/sms/smarty/Smarty.class.php on line 1105

Ten post edytował Zmorcia 18.08.2009, 10:46:43
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Strict Standards: Non-static method Smarty::display() should not be called statically, assuming $this from incompatible context in E:\Apache2\htdocs\smarty_test\index.php on line 23

Czyli dobrze myślałem, że smarty nie jest statyczne. Musisz do swojego obiektu przekazać egzemplarz obiektu smarty i na nim wywoływać metody.

Weź popraw nazwę swojej klasy bo to poniżej poziomu żałości http://www.getionary.pl/search?query=konku...l_ang&ln=pl

@Phpion - następnym razem uważaj co mówisz.

Ten post edytował wookieb 18.08.2009, 11:25:35
Go to the top of the page
+Quote Post
Zmorcia
post
Post #3





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

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


Cytat(wookieb @ 18.08.2009, 12:23:04 ) *
Strict Standards: Non-static method Smarty::display() should not be called statically, assuming $this from incompatible context in E:\Apache2\htdocs\smarty_test\index.php on line 23

Czyli dobrze myślałem, że smarty nie jest statyczne. Musisz do swojego obiektu przekazać egzemplarz obiektu smarty i na nim wywoływać metody.

Weź popraw nazwę swojej klasy bo to poniżej poziomu żałości http://www.getionary.pl/search?query=konku...l_ang&ln=pl

@Phpion - następnym razem uważaj co mówisz.




concurs = zgadza się (w nim głowna classa)


napisz mi jak ma wygladac cala classa, z tym egzemplazem.
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: 2.10.2025 - 23:59