本文整理匯總了PHP中Magento\Framework\View\FileSystem::getEmailTemplateFileName方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSystem::getEmailTemplateFileName方法的具體用法?PHP FileSystem::getEmailTemplateFileName怎麽用?PHP FileSystem::getEmailTemplateFileName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\FileSystem
的用法示例。
在下文中一共展示了FileSystem::getEmailTemplateFileName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetEmailTemplateFile
public function testGetEmailTemplateFile()
{
$locale = \Magento\Setup\Module\I18n\Locale::DEFAULT_SYSTEM_LOCALE;
$params = ['area' => 'some_area', 'themeModel' => $this->getMock('Magento\\Framework\\View\\Design\\ThemeInterface', [], [], '', false, false), 'module' => 'Some_Module', 'locale' => $locale];
$file = 'Some_Module::some_file.ext';
$expected = 'path/to/some_file.ext';
$this->_emailTemplateFileResolution->expects($this->once())->method('getFile')->with($params['area'], $params['themeModel'], $locale, $file, 'Some_Module')->will($this->returnValue($expected));
$actual = $this->_model->getEmailTemplateFileName($file, $params, 'Some_Module');
$this->assertEquals($expected, $actual);
}
示例2: getTemplateFilename
/**
* Retrieve full path to an email template file
*
* @param string $templateId
* @param array|null $designParams
* @return string
*/
public function getTemplateFilename($templateId, $designParams = [])
{
// If design params aren't passed, then use area/module defined in email_templates.xml
if (!isset($designParams['area'])) {
$designParams['area'] = $this->getTemplateArea($templateId);
}
$module = $this->getTemplateModule($templateId);
$designParams['module'] = $module;
$file = $this->_getInfo($templateId, 'file');
return $this->viewFileSystem->getEmailTemplateFileName($file, $designParams, $module);
}