마젠토 2:템플릿 파일에서 컨트롤러, 모듈, 작업 이름을 가져오시겠습니까?[복제하다]

magento.stackexchange https://magento.stackexchange.com/questions/109697

  •  29-09-2020
  •  | 
  •  

문제

템플릿 내에서 컨트롤러, 모듈 및 작업 이름을 어떻게 검색할 수 있나요?

도움이 되었습니까?

해결책

템플릿이 확장되는 경우 \Magento\Framework\View\Element\Template 그런 다음 다음을 통해 요청할 수 있습니다. $this->_request

다른 팁

쉬운 방법은

입니다.
$requestOb = $objectManager->get('Magento\Framework\App\Request\Http'); 


echo $requestOb->getModuleName();

echo $requestOb->getActionName(); 

echo $requestOb->getControllerName();
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top