本文整理匯總了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);
}
示例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);
}
示例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;
}