當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileSystem::getStaticFileName方法代碼示例

本文整理匯總了PHP中Magento\Framework\View\FileSystem::getStaticFileName方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSystem::getStaticFileName方法的具體用法?PHP FileSystem::getStaticFileName怎麽用?PHP FileSystem::getStaticFileName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\View\FileSystem的用法示例。


在下文中一共展示了FileSystem::getStaticFileName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetViewFile

 /**
  * @magentoComponentsDir Magento/Framework/View/_files/Fixture_Module
  */
 public function testGetViewFile()
 {
     $expected = '%s/frontend/Vendor/custom_theme/Fixture_Module/web/fixture_script.js';
     $params = ['theme' => 'Vendor_FrameworkThemeTest/custom_theme'];
     $actual = $this->_model->getStaticFileName('Fixture_Module::fixture_script.js', $params);
     $this->_testExpectedVersusActualFilename($expected, $actual);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:10,代碼來源:FileSystemTest.php

示例2: testGetViewFile

 public function testGetViewFile()
 {
     $params = ['area' => 'some_area', 'themeModel' => $this->getMock('Magento\\Framework\\View\\Design\\ThemeInterface', [], [], '', false, false), 'locale' => 'some_locale', 'module' => 'Some_Module'];
     $file = 'Some_Module::some_file.ext';
     $expected = 'path/to/some_file.ext';
     $this->_staticFileResolution->expects($this->once())->method('getFile')->with($params['area'], $params['themeModel'], $params['locale'], 'some_file.ext', 'Some_Module')->will($this->returnValue($expected));
     $actual = $this->_model->getStaticFileName($file, $params);
     $this->assertEquals($expected, $actual);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:9,代碼來源:FileSystemTest.php

示例3: _getWatermarkFilePath

 /**
  * Get relative watermark file path
  * or false if file not found
  *
  * @return string | bool
  */
 protected function _getWatermarkFilePath()
 {
     $filePath = false;
     if (!($file = $this->getWatermarkFile())) {
         return $filePath;
     }
     $baseDir = $this->_catalogProductMediaConfig->getBaseMediaPath();
     $candidates = array($baseDir . '/watermark/stores/' . $this->_storeManager->getStore()->getId() . $file, $baseDir . '/watermark/websites/' . $this->_storeManager->getWebsite()->getId() . $file, $baseDir . '/watermark/default/' . $file, $baseDir . '/watermark/' . $file);
     foreach ($candidates as $candidate) {
         if ($this->_mediaDirectory->isExist($candidate)) {
             $filePath = $this->_mediaDirectory->getAbsolutePath($candidate);
             break;
         }
     }
     if (!$filePath) {
         $filePath = $this->_viewFileSystem->getStaticFileName($file);
     }
     return $filePath;
 }
開發者ID:pavelnovitsky,項目名稱:magento2,代碼行數:25,代碼來源:Image.php


注:本文中的Magento\Framework\View\FileSystem::getStaticFileName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。