Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Filesystems 设置Smarty目录和路径_Filesystems_Smarty - Fatal编程技术网

Filesystems 设置Smarty目录和路径

Filesystems 设置Smarty目录和路径,filesystems,smarty,Filesystems,Smarty,对于使用Smarty模板引擎的人来说,这只是一个一般性问题 如何设置文件结构?我希望遵循MVC格式,但我不确定如何在Smarty控制器和模板中包含所有CSS、Javascript等,而不包括这些荒谬的路径 有人用过这个吗?有人有什么见解吗 谢谢! 马特 效果很好 包括加载所有内容的文件: require_once 'includes/class.foobar.php'; require_once 'smarty/Smarty.class.php'; 嗯 我建议另一种结构 支持这一点: 文档根目

对于使用Smarty模板引擎的人来说,这只是一个一般性问题

如何设置文件结构?我希望遵循MVC格式,但我不确定如何在Smarty控制器和模板中包含所有CSS、Javascript等,而不包括这些荒谬的路径

有人用过这个吗?有人有什么见解吗

谢谢! 马特

效果很好

包括加载所有内容的文件:

require_once 'includes/class.foobar.php';
require_once 'smarty/Smarty.class.php';

我建议另一种结构

支持这一点:

文档根目录:my_应用程序/public_html/

my_app/
   - lib
   - app
   - public_html/
     - css/
     - js/
     - images/
   - cache/
   - compiled_templates/
   - templates/
     - mails/
        - html/
        - text/
     - frontend/
     - backend/
     - xml/
在此情况下,您的模板位于文档根目录之外,因此。。他们受到保护。换句话说。。无论如何,您可以访问my/site/templates/somefile.tpl

您的_public_html_文件夹应包含用户可以访问的所有文件

lib文件夹包含您可以使用的所有实用程序类:smarty、database等

应用程序文件夹包含所有业务文件等

无论如何,我认为最重要的一点是前端和后端处于不同的级别

萨卢多斯

my_app/
   - lib
   - app
   - public_html/
     - css/
     - js/
     - images/
   - cache/
   - compiled_templates/
   - templates/
     - mails/
        - html/
        - text/
     - frontend/
     - backend/
     - xml/