How to convert $tpl->sub_load_template('sub.tpl'));
in the link of type index.php?do=sub
Well, look: http://makar3000.s3.webhost1.ru/panel2/index.php?do=login
A main.tpl
and a new template main.tpl
. In index.php
include ("templates.class.php"); $do = $_GET['do']; if ($do == 'login') { include './templates/login.tpl'; } $tpl = new Template; //ΠΈΠ½ΠΈΡΠΈΠΈΡΡΠ΅ΠΌ ΠΊΠ»Π°ΡΡ $tpl->dir = 'templates/'; //Π·Π°Π΄Π°ΡΠΌ ΠΌΠ΅ΡΡΠΎΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ ΠΏΠ°ΠΏΠΊΠΈ Ρ ΡΠ°Π±Π»ΠΎΠ½Π°ΠΌΠΈ $tpl->load_template('main.tpl'); //Π·Π°Π³ΡΡΠΆΠ°Π΅ΠΌ ΠΊΠ°ΡΠΊΠ°Ρ $tpl->compile('main'); //ΡΠΎΠ±ΠΈΡΠ°Π΅ΠΌ ΡΠ°Π±Π»ΠΎΠ½ echo $tpl->result['main']; //Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ ΡΠ΅Π·ΡΠ»ΡΡΠ°Ρ ΡΠ°Π±ΠΎΡΡ $tpl->global_clear(); //ΠΎΡΠΈΡΠ°Π΅ΠΌ Π²ΡΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ Π΄Π»Ρ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΡΠ»Π΅Π΄ΡΡΡΠ΅Π³ΠΎ ΡΠ°Π±Π»ΠΎΠ½Π°
But do I need to, when going to index.php?do=login
only shows login.tpl
.