Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> obiektowe podejcie do tablicy or whatever (:
UglyJoe
post
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 9.08.2007

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


czy taki zapis jest poprawny $template->loaded->block gdzie loaded to tablica obieku template ?
Go to the top of the page
+Quote Post
LBO
post
Post #2





Grupa: Zarejestrowani
Postów: 1 415
Pomógł: 117
Dołączył: 7.09.2005
Skąd: Warszawa

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


Nie, nie mozna.

Skoro $loaded to tablica poprawnym zapisem będzie.

  1. <?php
  2. $template->loaded['block']
  3. ?>
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #3





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Kochani. smile.gif
Metody magiczne __set() i __get().

Jaki konstruktor? haha.gif

Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
LBO
post
Post #4





Grupa: Zarejestrowani
Postów: 1 415
Pomógł: 117
Dołączył: 7.09.2005
Skąd: Warszawa

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


A jak ma się to do pytania UglyJoe?
Wyraźnie określił, że $loaded to tablica, nie obiekt.
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #5





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Cytat
(...) loaded to tablica obieku template ?


Jest zatem składową tego obiektu. Do składowej wiadomo jak się odnieść. $this->loaded.
Nic nie stoi na przeszkodzie, aby ta tablica miała otoczkę obiektową, a więc po prostu była obiektem z metodami __set() i __get().
Wtedy zaprezentowany w pierwszym poście sposób odnoszenia się do elementów tej tablicy jest poprawny ;]
Wiem o co chodzi uglyJoe - podaję jedynie jak zrobić to tak, aby działało smile.gif

Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
UglyJoe
post
Post #6





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 9.08.2007

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


hym .. w sumie powinienem przemyslec sprawe zanim cos napisze, aczkolwiek sie czegos nauczylem , (: . $loaded jest obiektem simpleXml stworzonym w klasie template wiec da sie go zarowno traktowac jako obiekt, oraz tablice .chyba ze sie myle .. .. ?
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #7





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Sprawdź, Skoro działa, to znaczy, że się nie mylisz ;p


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post

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 Aktualny czas: 21.08.2025 - 10:59