A blank page is running, I don't know where I didn't reference it. All the folders are in the same directory. My project contains the following folders: Smartysmarty_cache. The files are created separately by me. templates_c... the webpage is blank and I don't know where the reference is correct.
All Folders are under the same directory.
My project contains the following folders:
/Smarty
/Smarty_cache this file is created separately
/Templates this file is created separately
/Templates_c this file is created separately
Three files:/index. php/smarty. inc. php/templates/index. cpl
The content in index. php is as follows:
1
Assign ('kaishi', 'I don't know how to test it! '); 5 $ smarty-> display ('index. cpl'); 6 7?>
The code in smarty. inc. php is as follows:
01
Config_dir = ". /Smarty/Config_File.class.php "; // directory variable setting class 05 $ smarty-> caching = false; // do not use cache 06 $ smarty-> template_dir = ". /templates "; // set the template directory 07 $ smarty-> complie_dir = ". /templates_c "; // set the template compilation directory 08 $ smarty-> cache_dir = ". /smarty_cache "; // cache folder 09 $ smarty-> left_delimiter =" {"; 10 $ smarty-> right_delimiter ="} "; 11?>
The code in/templates/index. cpl is as follows:
01020304{$kaishi}0506070809hello,{$kaishi}10
1112
The page is blank after running
Reply content:
The webpage is blank and I don't know where the reference is correct.
All Folders are under the same directory.
My project contains the following folders:
/Smarty
/Smarty_cache this file is created separately
/Templates this file is created separately
/Templates_c this file is created separately
Three files:/index. php/smarty. inc. php/templates/index. cpl
The content in index. php is as follows:
1
Assign ('kaishi', 'I don't know how to test it! '); 5 $ smarty-> display ('index. cpl'); 6 7?>
The code in smarty. inc. php is as follows:
01
Config_dir = ". /Smarty/Config_File.class.php "; // directory variable setting class 05 $ smarty-> caching = false; // do not use cache 06 $ smarty-> template_dir = ". /templates "; // set the template directory 07 $ smarty-> complie_dir = ". /templates_c "; // set the template compilation directory 08 $ smarty-> cache_dir = ". /smarty_cache "; // cache folder 09 $ smarty-> left_delimiter =" {"; 10 $ smarty-> right_delimiter ="} "; 11?>
The code in/templates/index. cpl is as follows:
01020304{$kaishi}0506070809hello,{$kaishi}10
1112
The page is blank after running
There is no problem with the code you write. You may ignore the issue.
1. If you are doing a test in linux, it may be that your php error is not reported.
2. It is a test in the window. According to your description, you can only determine that the template is not parsed (otherwise, at least 'hello, 'will appear ,').
Your template file should not be loaded.