这是网上找的smarty设置的段代码。
一开始提示
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in F:phpstudyWWWsmartysconfig.php on line 2
我看到第二行没问题啊,于是自己从新敲了一遍,一抹一样的,就好了。
然后提示
Parse error: syntax error, unexpected T_VARIABLE in F:phpstudyWWWsmartysconfig.php on line 4
这就很费解了,$tpl = new Smarty(); 这句话有错吗?
使用官方Model Context Protocol PHP SDK将PHP应用程序功能暴露为MCP工具、资源和提示,用于代理工作流。
谢谢。
<?php include "/smarty/libs/Smarty.class.php"; define(@#__SITE_ROOT@#, @#f:/phpstudy/WWW/smartys/smarty@#); // 最后没有斜线 $tpl = new Smarty(); $tpl->template_dir = __SITE_ROOT . "/templates/"; $tpl->compile_dir = __SITE_ROOT . "/templates_c/"; $tpl->config_dir = __SITE_ROOT . "/configs/"; $tpl->cache_dir = __SITE_ROOT . "/cache/"; $tpl->left_delimiter = @#right_delimiter = @#}>@#; ?>
php免费学习视频:立即使用
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!










