0
我的文件夹结构如下:Smarty的整合到定制的PHP MVC
config/
controller/
core/
lib/
smarty/
All Smarty Files
model/
views/
index.php
我的MVC会将所有网络流量通过的index.php其中包括autloading下面的代码:
function __autoload($class){
$file = sprintf('%smodel/%s.class.php',__SITE_PATH,$class);
if(is_file($file)){
include $file;
return;
}
$file = sprintf('%smodel/%s.php',__SITE_PATH,$class);
echo $file;
if(is_file($file)){
include $file;
return;
}
}
保持在介意你被迫使用不支持命名空间或SPLAutoloading的PHP版本,你将如何改变__autoload函数或Smarty与你的网站打好关系(工作)?
我的具体问题是,当smarty_internal_smartytemplatecompiler.php试图包含一个文件时,它正在查看模型文件夹而不是smarty文件夹。我想我可以将Smarty转移到模型上,但这看起来并不“正确”。