คำถามติดแท็ก paths

4
วิธีรับเส้นทางไดเรกทอรีรูตใน phtml magento 2
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $mediaPath = $fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath(); มันส่งคืนเส้นทางสื่อ วิธีรับรูทพา ธ ของโครงการในหน้า phtml

4
วิธีรับเส้นทางไดเรกทอรีสื่อในไฟล์ phtml ใน magento 2
ใช้วิธีการด้านล่างเพื่อรับเส้นทางไดเรกทอรีสื่อแต่มันกลับข้อผิดพลาด $om = \Magento\Core\Model\ObjectManager::getInstance(); $directoryList = $om->get(\Magento\App\Filesystem\DirectoryList::class); $pubMediaDir = $directoryList->getPath(\Magento\App\Filesystem\DirectoryList::MEDIA); โปรดช่วยฉันหาวิธีแก้ปัญหา
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.