使用Autoloader.php通过FTP配置细枝
我尝试让Twig在我的应用程序中工作 所以,我在使用Autoloader.php通过FTP配置细枝,php,html,ftp,twig,Php,Html,Ftp,Twig,我尝试让Twig在我的应用程序中工作 所以,我在Twig文件夹中解包并上传了FTP上的Twig文件 我在twig_templatesfolder templatebase.twig中创建了如下内容: <!DOCTYPE html> <html lang="pl"> <head> <title>{{title}}</title> <meta charset="UTF-8">
Twig
文件夹中解包并上传了FTP上的Twig文件
我在twig_templates
folder templatebase.twig
中创建了如下内容:
<!DOCTYPE html>
<html lang="pl">
<head>
<title>{{title}}</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="content-container">
<{{type}} id="content">
{% block content %}
{% endblock %}
</{{type}}>
</div>
</body>
</html>
我完全无法让它工作,也不知道为什么。我试过使用
.twig
和.html
文件,但似乎没有任何区别。(对我来说)代码似乎很好,所以可能都是关于Twig配置的?您遇到了什么错误?到目前为止,我还没有注意到任何错误日志,我不知道如何获取错误日志:/能否请您解释如何通过FTP连接Netbeans 8.0来获取服务器错误?(只有我收到的消息与正确的FTP连接有关。)
<?php
require_once '/Twig/lib/Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('/twig_templates');
$twig = new Twig_Environment($loader, array(
'cache' => '/twig_templates/cache') );
$template = $twig->loadTemplate('base.twig');
echo $template->render(array (title=>"title", type=>"article"));
?>