2010-03-11 77 views
-1

是我的文件夾Smarty的路徑問題

index.php 
smartyhere 
    -Smarty.class.php 
admin 
    -index.php 
    -users.php 
的index.php中

- > $ smarty->顯示( '在index.tpl');

in admin/index.php - > $ smarty-> display('adminindex.tpl'); 有錯誤Smarty錯誤:無法讀取資源:「adminindex.tpl」

有什麼想法嗎? THX

+0

能否請您包括Smarty的文件夾和文件嗎? – Cetra 2010-03-11 04:03:23

回答

-2

試圖理解代碼

其進行urlencode做路徑

<?php 

print_r($file); 

if (isset($file)) { 
    $var = explode("-", $file); 
    print_r($var); 
    $prefix = $var[0]; 
    $script = $var[1]; 
} else { 
    $file = "c-home1"; 
    $prefix = "c"; 
    $script = "home"; 
    $modid = 0; 
} 

if ($script=="") { 
    $script="prod_list"; 
} 

/* 
* following code finds out the modules from suffix 
* and find out the script name 
*/ 
switch ($prefix) { 
    case "c": 
     $module = "content"; 
     break; 
    case "m": 
     $module = "myaccount"; 
     break; 
    default: 
     $module = "content"; 
     break; 
} 

$smarty->assign("module",$module); 

/* 
* following code finds out the modules from suffix and 
* find out the script name 
*/ 
$include_script .= $module."/".$script.".php"; 

if (file_exists($include_script)) { 
    include_once $include_script; 
} else { 
    include_once "content/error.php"; 
} 

if ($script!='home') { 
    if ($script == 'termsandcondition') { 
     $smarty->display("content/termsandcondition.tpl"); 
    } else { 
     $smarty->display("template.tpl"); 
    } 
} else { 
    $smarty->display("template_home.tpl"); 
    $smarty->assign("msg", $msg); 
    $smarty->assign("msglogin", $msglogin); 
} 
+0

你是指「哪個urlencode正在做的路徑」是什麼意思? – noisebleed 2012-04-05 13:23:01