Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PHP problem z polem
nati321
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 20.01.2013

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


Cześć. Mam taki kod:
  1. <?php
  2. class view {
  3. public function __construct($file_name) {
  4. if(file_exists('template/'.$file_name)) {
  5. include('template/'.$file_name);
  6. }else echo('Brak pliku');
  7. }
  8. }
  9. class controller {
  10.  
  11. public $view;
  12. public function __construct() {
  13. $this->view = new view('index.phtml');
  14. $this->view->nazwa = 'To jest moja nazwa';
  15. }
  16. }
  17. $controller = new controller();
  18. ?>


I chciałam wyświetlić w pliku index.phtml zmienna nazwa tak: $this->nazwa ... Co robię źle? Dopiero się ucze... Dziękuje z góry
Go to the top of the page
+Quote Post

Posty w temacie
- nati321   PHP problem z polem   20.01.2013, 11:18:15
- - sajegib   sprawdz pw   20.01.2013, 11:43:13


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: 22.08.2025 - 23:50