![](/img/trans.png)
[英]Magento - How can I set a diffrent phtml for a block in an observer?
[英]How can set post value and unset it by observer magento 2
我想通過當前網址獲取數據,所以我設置了帖子值,請參見我的代碼
if (currenturl = 'https://example.com/delhi.html') {
$this->request->setPostValue('location','289');
}
但是它為所有頁面設置了,如果要打開另一個URL,我想取消設置。 請任何人為此的想法
嘗試這個,
$this->request->setPostValue('location','');
if (currenturl = 'https://example.com/delhi.html') {
$this->request->setPostValue('location','289');
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.