Smarty error: yntaxerror: unrecognizedtag-php Tutorial

Source: Internet
Author: User
Smarty reports the following error: yntaxerror: unrecognizedtag Fatal error: Smarty error: [in. /log_default.shtml line 92]: syntax error: unrecognized tag: $ lang. type. $ log_type.op_type_con [$ info_v.op_type]. op_types [$ other_k] [$ info_v. $ other_k] (Smarty_Compiler.class.php, line 446) in F: \ work \ zszw \ manager \ web \ lib \ smarty \ Smarty. class. php on line 1093



Reply to discussion (solution)

$ Lang_template ['type'] = array (
// Log name
'Log _ treasure '=> array (
'Name' => 'treasure log ',
// Operation type
'Op _ type' => array (
'Openbox' => 'open trease ',
),
// Type content
'Op _ type_con '=> array (
'Openbox' => array (
// Except for public op_timestamp, op_type, op_result, role_id, and role_name, but not in json
'Other _ field' => array (
'Type' => 'type ',
),
// Json data
'Json _ field' => array (
'Times '=> 'Operation times ',
'Cost' => 'cost ',
'Item _ list' => 'reward list ',
),
// Optional field. whether to directly display the field value. if it is displayed in this array, the field value will be converted.
'Op _ types '=> array (
'Type' => array (
'1' => 'Bronze ',
'2' => 'golden ',
'3' => 'mymy ',
),
),
),
// 'Type 2' => array (
// 'Field 1' => 'field description ',
// 'Field 2' => 'field description ',
//// Optional field. whether to directly display the field value. if it appears in this array, the field value will be converted.
// 'Op _ types '=> array (
// 'Field 2' => array (
// 'Field value 1' => 'field value description ',
// 'Field value 2' => 'field value description ',
//),
//),
//),
),
),
);
?>
<{If $ v. other_field}>
<{Foreach from = $ v. other_field key = other_k item = other_v}>

<{If! Empty ($ lang. type. $ log_type.op_type_con [$ info_v.op_type]. op_types. $ other_k)}>
<{$ Lang. type. $ log_type.op_type_con [$ info_v.op_type]. op_types [$ other_k] [$ info_v. $ other_k]}>
<{Else}>
<{$ Info_v. $ other_k}>
<{/If}>

<{/Foreach}>
<{/If}>
The preceding is an array configuration used in the template.

$ Lang. type. $ log_type.op_type_con [$ info_v.op_type]. op_types. $ other_k
Who told you it could be written like this?

In this case, no error is reported ,~ The following error is reported: 5555
<{$ Lang. type. $ log_type.op_type_con [$ info_v.op_type]. op_types [$ other_k] [$ info_v. $ other_k]}>

The most important thing is [$ other_k] [$ info_v. $ other_k] An error is returned when I write the old one like this. I wrote [$ other_k] [1] [$ other_k] [2] [$ other_k] [3] \
Can be called.

If you want to get the value of the array, you can use the loop to get it. if you cannot support the value of the variable array, you can change the method.

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.