我想自动生成行的序列号。我给出的代码不起作用

时间:2016-10-26 06:27:17

标签: php smarty

我想自动生成行的序列号。我给出的代码无效

{if ($invoice.type_id == 2) || ($invoice.type_id == 3) }
    {foreach from=$invoiceItems item=invoiceItem}
        <tr>
            {assign var=number value=0}
              {foreach number=$var+1}
                 <td>
                   {$number}
                 </td>
              {/foreach}
         </tr>
    {/foreach}
{/if}

1 个答案:

答案 0 :(得分:0)

您是否尝试过related question的解决方案?

  

from urllib.request import urlopen from urllib.error import HTTPError from bs4 import BeautifulSoup from selenium import webdriver def openUrl(link): driver = webdriver.PhantomJS( executable_path='../../phantomjs/bin/phantomjs') try: driver.get(link) except HTTPError as e: print ('Error opening ' + link) continue try: bsObj = BeautifulSoup(driver.page_source) except AttributeError as e: return None try: elem1 = driver.find_element_by_name('checkAndShowAnswers') elem1.click() except: continue