otóż mam klasę
<?php class a extends Smarty { public $tytulik = 'Brak tytuliku'; public function __construct() { $this -> Smarty(); $this -> template_dir = '../templates/'; $this -> compile_dir = '../templates_c/'; $this -> config_dir = '../configs/'; $this -> cache_dir = '../cache/'; $this -> compile_check = true; $this -> debugging = true; $this -> force_compile = true; $this -> caching = 0; } } ?>
i teraz dzięki odwołaniu
<?php require '../class.php'; $smarty = new a; $smarty -> ('tytulik', 'Tytulik Strony'); $smarty -> assign('tytulik', $smarty -> tytulik); $smarty -> display('page.tpl'); ?>
chodzi mi dokładnie o to w jaki sposób przekazywać informacje do klasy żeby ta odpowiednio
to każde z podstron ładowała inny skrypt tpl oraz pobierała dane z bazy.
np: index.php?all wyświetla news.php i dodatkowo pobiera z bazy wszystkie pola z tabeli
a index.php?last tylko ostatni rekord.
chodzi mi tutaj o wkomponowanie tego w klasę.