如何显示在标题我的帐户链接后在Magento 2.0
答
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
// display your link here
}
---------------------- from controller -------------------
$this->_objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
// display your link here
}