Witam ostatnio myślałam nad naukom OOP lecz napotkałam na problem
otóż mam klasę
  1. <?php
  2. class a extends Smarty
  3. {
  4. public $tytulik = 'Brak tytuliku';
  5.  
  6. public function __construct()
  7. {
  8. $this -> Smarty();
  9.  
  10. $this -> template_dir = '../templates/';
  11. $this -> compile_dir = '../templates_c/';
  12. $this -> config_dir  = '../configs/';
  13. $this -> cache_dir = '../cache/';
  14.  
  15. $this -> compile_check = true;
  16. $this -> debugging = true;
  17. $this -> force_compile = true;
  18. $this -> caching = 0;
  19. }
  20. }
  21. ?>


i teraz dzięki odwołaniu

  1. <?php
  2. require '../class.php';
  3. $smarty = new a;
  4. $smarty -> ('tytulik', 'Tytulik Strony');
  5. $smarty -> assign('tytulik', $smarty -> tytulik);
  6. $smarty -> display('page.tpl');
  7. ?>


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ę.