###前提・実現したいこと
さくらVPSにてsmartyを入れたのですがtplファイルを読み込みません。
どのように設定すれば良いのでしょうか?
階層は以下のようになっています。
/var/www/html
∟Smarty(ここにsmartyのlibs一式)
∟templates
∟templates_c
∟index.php
###発生している問題・エラーメッセージ
tplファイルが読み込まれていないのか白紙のページが表示されてしまいます。
###該当のソースコード
index.php <?php require_once('/var/www/html/Smarty/Smarty.class.php'); $smarty = new Smarty(); $smarty->template_dir = '/var/www/html/templates'; $smarty->compile_dir = '/var/www/html/templates_c'; $smarty->display('index.tpl');
index.tpl <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Smartyテスト</title> <link rel="stylesheet" href="comn/style.css"> </head> <body> Smartyテストページ </body> </html
###補足情報(言語/FW/ツール等のバージョンなど)
CentOS7
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。