Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Własny system szablonów - problem z wyświetlaniem kodu PHP
Tajgeer
post
Post #1





Grupa: Zarejestrowani
Postów: 290
Pomógł: 48
Dołączył: 11.05.2008
Skąd: Kielce

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


Witam,

Od jakiegoś czasu pracuje nad swoim własnym CMSem.

Plik core/objects/template.class.php
http://wklej.org/id/119515/

Plik index.php
  1. <?php
  2. require('core/config.php');
  3. echo Template::ParseTemplate('index_page');
  4. ?>


Plik core/config.php
  1. <?php
  2. // klasa konfiguracyjna
  3. class Config
  4. {
  5.    // database configuration
  6.    const DBHost                    = 'xxx';
  7.    const DBUser                    = 'xxx';
  8.    const DBPassword                = 'xxx';
  9.    const DBName                    = 'xxx';
  10.    const DBCharset                    = 'xxx';
  11.  
  12.    // database tables
  13.    const DownloadTable                = 'xxx';
  14.    const NewsTable                    = 'xxx';
  15.    
  16.    // file paths
  17.    const MainPath                    = 'xxx';
  18.    const ObjectsPath                = 'core/objects/';
  19.    const SQLLogsPath                = 'logs/sql';
  20.    const InternalLogsPath            = 'logs/internal';
  21.    
  22.    // site configuration
  23.    const Template                    = '1';
  24.    const Keywords                    = 'costam niewaznego';
  25.    const Description                = 'costam niewaznego';
  26.    const Copyright                    = 'costam niewaznego';
  27.    const Charset                    = 'UTF-8';
  28. }
  29. // koniec klasy
  30.  
  31. // potrzebne pliki
  32. require(''.Config::ObjectsPath.'db.class.php');
  33. require(''.Config::ObjectsPath.'news.class.php');
  34. require(''.Config::ObjectsPath.'download.class.php');
  35. require(''.Config::ObjectsPath.'log.class.php');
  36. require(''.Config::ObjectsPath.'template.class.php');
  37.  
  38. // inicjowanie klas
  39. $db = new DB;
  40. ?>


Problem polega na tym, że jak np. dodam do jakiegokolwiek z plików (right_menu.php, left_menu.php czy index_page.php) kod PHP - na stronie nie jest on wyświetlany. Jak zmodyfikować moją klasę, aby móc również wyświetlać kod PHP, a nie tylko statyczny HTML?

Ten post edytował Tajgeer 11.07.2009, 12:29:34
Go to the top of the page
+Quote Post

Posty w temacie


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 - 11:08