2016-07-08 32 views

回答

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 
      } 
相关问题