Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> global w klasach
ennics
post
Post #1





Grupa: Zarejestrowani
Postów: 312
Pomógł: 0
Dołączył: 29.12.2004

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


na tym etapie wygląda to tak
  1. <?php
  2. class stepOne
  3. {
  4. public function __construct()
  5. {
  6. global $_DOCUMENTS;
  7. extract( $_DOCUMENTS );
  8.  
  9. print &#092;"<table width='100%'><tr><td width='100%' class='TTh' colspan='2'>\";
  10. foreach ( $_DOCUMENTS as $this -> key => $this -> val )
  11. {
  12. global $this -> key; // <---- nie działa...
  13. extract( $this -> key );
  14. print &#092;"<input id='id\" . $this -> key . \"' type='radio' name='DOCUMENTS' value='\" . $this -> key . \"'>\" . $this -> val . \"<br>n\";
  15. }
  16. print &#092;"</td></tr></table>\";
  17.  
  18. }
  19. }
  20.  
  21. ?>

pojawia się err: Fatal error: Cannot re-assign $this in C:\apache2triad\htdocs\ju\class.one.php on line 45

jak zglobalizować $this -> key w foreach (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

Ten post edytował ennics 2.04.2005, 15:56:09
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: 23.12.2025 - 18:24