This is the segment code of the smarty settings found on the Internet. At the beginning, the system prompts Parseerror: syntaxerror, unexpectedT_CONSTANT_ENCAPSED_STRINGinF: phpstudyWWWsmartysconfig. phponline2 I saw that the second line was okay, so I typed it again... this is the segment code of the smarty settings found on the Internet.
Start prompt
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in F: phpstudyWWWsmartysconfig. php on line 2
I saw that there was no problem in the second line, so I made a new one, and it would be nice to have the same touch.
Then prompt
Parse error: syntax error, unexpected T_VARIABLE in F: phpstudyWWWsmartysconfig. php on line 4
This is hard to understand. $ tpl = new Smarty (); is this a mistake?
Thank you.
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 ==#<{#; $ tpl-> right_delimiter ==#}>##;?>
Reply content:
This is the segment code of the smarty settings found on the Internet.
Start prompt
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in F: phpstudyWWWsmartysconfig. php on line 2
I saw that there was no problem in the second line, so I made a new one, and it would be nice to have the same touch.
Then prompt
Parse error: syntax error, unexpected T_VARIABLE in F: phpstudyWWWsmartysconfig. php on line 4
This is hard to understand. $ tpl = new Smarty (); is this a mistake?
Thank you.
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 ==#<{#; $ tpl-> right_delimiter ==#}>##;?>
Make sure that the reference path is correct, orsmartyRemove the brackets and try again. For example
$tpl = new Smarty;
Is the path introduced in the first line incorrect?
Like path problems? Remove the initial slash of the path ..
The first error is like a BOM problem. do not use notepad to save it.
@#What is it? is there a problem with my display?
In addition, many people say that the introduction path is incorrect. the error occurs during the code interpretation period and has not been executed yet.
@ # What is it? Check the error message. you are not new Smarty; an error is not an include error.
Are you online? I guess it's a Chinese character that causes a parsing error and cannot be seen by the naked eye.