我有这个原始代码:
<div class="heading">
<h1><img src="view/image/customer.png" alt="" /> <?php echo $heading_title; ?></h1>
<div class="buttons"><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
</div>
我的 VQMod 文件如下所示:
<modification>
<id>Backorder</id>
<version>1.0</version>
<vqmver>1.2.3</vqmver>
<author>Author</author>
<file name="admin/controller/sale/order.php">
<operation>
<search position="after"><![CDATA[$this->data['heading_title'] = $this->language->get('heading_title');]]></search>
<add><![CDATA[
$this->data['backorder_text'] = 'Backorder';
$this->data['backorder_link'] = $this->url->link('backorder/backorder', 'token=' . $this->session->data['token'] . '&ouid=' . $order_id, 'SSL');
]]></add>
</operation>
</file>
<file name="admin/view/template/sale/order_info.tpl">
<operation>
<search position="after"><![CDATA[<?php echo $button_cancel; ?></a>]]></search>
<add><![CDATA[<a href="<?php echo $backorder_link; ?>" class="button"><?php echo $backorder_text; ?></a>]]></add>
</operation>
</file>
</modification>
如果我理解 VQMod 正确,这应该是输出的 HTML:
<div class="heading">
<h1><img src="view/image/order.png" alt=""> Bestellingen</h1>
<div class="buttons">
<a href="leLink" target="_blank" class="button">Factuur printen</a>
<a href="leLink" class="button">Annuleren</a>
<a href="leLink" class="button">Backorder</a>
</div>
</div>
但这是生成的:
<div class="heading">
<h1><img src="view/image/order.png" alt=""> Bestellingen</h1>
<div class="buttons">
<a href="leLink" target="_blank" class="button">Factuur printen</a>
<a href="leLink" class="button">Annuleren</a>
</div>
<a href="leLink" class="button">Backorder</a>
</div>
如您所见,我插入的链接是否在 div 之外。这是破坏布局。有人知道我在做什么错吗?