我的控制器中有两种方法,我调用它来获取各种 ajax 更新的 html。
protected function _getDemoShippingMethodsHtml()
{
$layout = $this->getLayout();
$update = $layout->getUpdate();
$update->load('checkout_onepage_demoshippingmethod');
$layout->generateXml();
$layout->generateBlocks();
$output = $layout->getOutput();
return $output;
}
protected function _getSelectedDealerHtml()
{
$layout = $this->getLayout();
$update = $layout->getUpdate();
$update->load('checkout_onepage_selecteddealer');
$layout->generateXml();
$layout->generateBlocks();
$output = $layout->getOutput();
return $output;
}
在向我的控制器发出一个请求期间,如果我只调用其中一种方法,它会按预期加载块。问题出现在我尝试在一个请求期间调用这两个函数的地方。调用哪个方法首先输出预期的 html,然后第二个方法调用输出与第一个完全相同的 html。