Smarty-where is the php error? I did not find it.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.