|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
m2007 Smarty n00b
Joined: 08 Apr 2009 Posts: 2
|
Posted: Wed Apr 08, 2009 9:45 am Post subject: Smarty , Zmienna $file |
|
|
Witam , mam maly problemzktorymnie moge sie uporac od 2 dni , a mianowiscie mam index.tpl , index.php ktory to wszystko obluguje linki itd i mam pliki html ktore maja byc wyswietlane po kliknieciu na link , niestety zmienna $file nie zmienia sie po kliknieciu na link zostaje caly czas jako home.html i dzieje sie to tylko na zdalych serverach , jak otwieram stronke u siebie z krasnala to wszystko dziala ladnie wklejam kilka kodow :
Wlasnie zauwazylem ze w teamplates_c pliki sie nie pojawiaja , a powinny ustawilem prawa na 777 ale dalej nic
index.php
Quote: |
<?
if ($endsession=="logout")
session_destroy();
else
?>
<?
require('Smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = 'desings';
$smarty->compile_dir = 'desings/templates_c';
$smarty->cache_dir = 'desings/cache';
$smarty->config_dir = 'desings/config';
if ($show==home) {
$smarty->assign('file','../html/home.html');
}
else
if ($show==search && $action==result) {
include('./search.php');
$smarty->assign('file','../html/result.php');
}
else
if ($show=="search"){
$smarty->assign('file','../html/search.html');
}
else
if ($show==registre && $action==done) {
include('./registre.php');
$smarty->assign('file','html/registred.html');
}
else
if ($show==registre && $action==null) {
$smarty->assign('file','../html/registre.html');
}
else
if ($show==contactus) {
$smarty->assign('file','../html/contactus.html');
}
else
if ($show==login) {
$smarty->assign('file','../html/login.html');
}
else
if ($show==logout) {
$smarty->assign('file','../html/logout.html');
}
else
if ($show=="")
{
$smarty->assign('file','../html/home.html');
}
$smarty->display('index.tpl');
?>
|
kawalek index.tpl
Quote: |
</td>
</tr>
<tr>
<td width="800" height="100%" bgcolor="#1D1D1D" bordercolor="#FF0000" valign="top">
{include file="$file" }
</td>
</tr>
<tr>
|
co moge miec nie tak ze zmienna $fille sie nie zmienia ?
[/quote] |
|
Back to top |
|
fornve Smarty Rookie
Joined: 25 Apr 2008 Posts: 29 Location: Sheffield, UK
|
Posted: Thu Apr 09, 2009 9:21 am Post subject: |
|
|
a co sie pokazuje gdy na poczatku index.php dasz:
var_dump( $show );
woogole skad bierzesz te zmienna?
a moze
var_dump( $_GET[ 'show' ] );
Pozdrawiam |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|