The directory structure of my smarty configuration is as follows: smarty_pro1 & nbsp; --- libs & nbsp; --- config & nbsp; --- templates (here I put one, index. tpl) & nbsp; --- templates_c & what's wrong with my smarty configuration?
The directory structure is as follows: smarty_pro1
--- Libs
--- Config
--- Templates (here, index. tpl)
--- Templates_c
--- Cache
Index. php
The content in index. php is
Define ('smarty _ path', '../smarty_pro1 /');
Include_once (SMARTY_PATH. 'libs/Smarty. class. php ');
$ Smarty = new Smarty ();
$ Smarty-> template_dir = SMARTY_PATH. 'Templates /';
$ Smarty-> compile_dir = SMARTY_PATH. 'Templates _ c /';
$ Smarty-> config_dir = SMARTY_PATH. 'configs /';
$ Smarty-> cache_dir = SMARTY_PATH. 'cache /';
$ Smarty-> left_delimiter = '{';
$ Smarty-> right_delimiter = '}';
$ Smarty-> assign ('title', 'Test ');
$ Smarty-> assign ('content', 'Content ');
$ Smarty-> display ('index. tpl ');
?>
Index. tpl content is
{$ Title}
{$ Content}
Why are there no values for the two variables in the result? I haven't done well for a long time. what is the problem?
------ Solution --------------------
PHP code
$ Smarty-> left_delimiter = '{'; // pay attention to the space in the quotation marks $ smarty-> right_delimiter = '}'; // pay attention to the space in the quotation marks
------ Solution --------------------
Discussion
PHP code
$ Smarty-> left_delimiter = '{'; // pay attention to spaces in quotation marks.
$ Smarty-> right_delimiter = '}'; // pay attention to spaces in quotation marks
If you really like to add spaces in {}, please tell smarty your habits!