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.