我一直在尝试在弹出窗口的按钮中添加下载功能,但它无法正常工作。
我创建了一个文件view.popup.php
代码是:
<?php
require_once('include/MVC/View/views/view.popup.php');
class FP_PAYMENTSViewPopup extends ViewPopup
{
public function __construct()
{
parent::__construct();
}
public function display()
{
global $app_strings;
$id = BeanFactory::getBean('FP_PAYMENTS', $this->bean->id);
$url = "index.php?module=FP_PAYMENTS&action=generatePaymentsPdf&record={$id}";
echo parent::display();
echo <<<PaymentButton
<input type="button" class="button" style="width: 150px;" href="#" value="Payment Pdf" onmouseover='hiliteItem(this,"yes");'
onmouseout='unhiliteItem(this);'
onclick="SUGAR.ajaxUI.loadContent('{$url}')"
" />
PaymentButton;
}
}
请问任何可以帮我找到错误的专家?提前致谢。
打印付款按钮时出现很多错误。你没有管理报价和转义序列。
你需要尝试这样的
echo "<input type='button' class='button' style='width: 150px;' href='#' value='Payment Pdf' onmouseover='hiliteItem(this,\'yes\');'
onmouseout='unhiliteItem(this);'
onclick='SUGAR.ajaxUI.loadContent(\'{$url}\')'
/>"