Riya
Riya

Reputation: 1

Fatal Error with Smarty - Unknown tag 'math'

I am using PHP 8 and Smarty 4.0.0 version. I have used math equation in my .tpl file.


{assign var=total value=0}
{section name=i start=0 loop=$serial_list|@count}
{math assign="total" equation="a" a=$serial_list|@count}
<tr class="" >
<td  width="5%" align='center' valign='middle'><strong>{$smarty.section.i.index+1}</strong> </td>
<td width="6%">{$serial_list[i].serial_no}</td>
<td width="5%">{$serial_list[i].prod_ord_no}</td>
<td width="5%">{$serial_list[i].mat_code}</td>
<td width="5%">{$serial_list[i].batch_no}</td>
<td width="4%">{$serial_list[i].gp_batch_no}</td> 
<td width="8%">{$serial_list[i].mat_size}</td>
<td width="9%">&nbsp;{$serial_list[i].mat_desc}</td>
<td width="5%">&nbsp;{$serial_list[i].insp_lot_no}</td> 
<td width="5%">&nbsp;{$serial_list[i].mfg_date}</td>
<td width="5%">&nbsp;{$serial_list[i].exp_date}</td> 

</tr>
{/section}


But smarty errors:

>Fatal error: Uncaught --> Smarty Compiler: Syntax error in template >"file:C:\xampp8\htdocs\test\smarty\templates\reports\get_gp_data_from_sap.tpl" on line 110 "{math >equation="x + y" x='5' y='5'}" unknown tag 'math' C:\xampp8\htdocs\test\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 110

How can I solve this?

Upvotes: 0

Views: 354

Answers (1)

noobeveryday
noobeveryday

Reputation: 79

Check file exists: /smarty4/plugins/function.math.php

Upvotes: 0

Related Questions