twig to tpl条件运算符的转换

时间:2018-03-19 14:23:17

标签: opencart2.3

Private Sub B_Save_Click()

Application.DisplayAlerts = False
Application.ScreenUpdating = False

path = "Z:\General\"
wbnam = "Data Base_2018.xlsb"
Workbooks.Open Filename:=path & wbnam, WriteResPassword:="Magellan7", ReadOnly:=False

Set Dest = ActiveWorkbook

If Dest.ReadOnly Then
Dest.Close
MsgBox "Someone currently updating UM. Please try again later.", vbInformation
Exit Sub
End If

mon = WorksheetFunction.Text(TB_Date.Text, "mmm")

Set Destsht = Dest.Sheets(mon)

Destsht.Activate
lrow = Destsht.Cells(Destsht.Rows.count, "A").End(xlUp).Row
lrow = lrow + 1

Cells(lrow, ukey).Value = Trim(CB_Key.Text)
Cells(lrow, ud).Value = Trim(TB_Date.Text)
txt = Trim(CB_Name.Text)

Cells(lrow, uact).Value = Trim(CB_Activity.Text)
Cells(lrow, qa).Value = Trim(CB_QAfor.Text)

Cells(lrow, utrac).Value = Trim(TB_Track.Text)
Cells(lrow, usit).Value = Trim(TB_Site.Text)
Cells(lrow, utim).Value = Trim(TB_Time.Text)

Cells(lrow, acat).Value = Trim(val(TB_Act_Cat.Text))
Cells(lrow, atag).Value = Trim(val(TB_Act_Tag.Text))
Cells(lrow, aval).Value = Trim(val(TB_Act_Val.Text))
  
Cells(lrow, rcnt).Value = Trim(val(TB_Reso.Text))

Cells(lrow, alcat).Value = Trim(TB_Al_Cat.Text)
Cells(lrow, altag).Value = Trim(TB_Al_Tag.Text)
Cells(lrow, alval).Value = Trim(TB_Al_Val.Text)
  
MsgBox "UM udpated successfully", vbInformation

Dest.Close savechanges:=True

End Sub

我正在尝试更改此设置和i运算符以更改此代码。 这是twig文件代码。我们怎样才能在tpl文件中编写这个代码。我特别在上面三个代码中解决了这样的条件运算符问题。意味着我怎么能在tpl中准确转换这一行。我正在将opencart 3.0.2.0主题转换为opencart 2.3.0.2。我尽我所能了解如何在tpl中更改此代码但无法解决问题。谢谢

1 个答案:

答案 0 :(得分:1)

你可以像这样在.tpl中编写上面的代码

<?php 
$i = 0;
$i++;
if($i%2==0){}
?>