Пример #1
0
 /**
  * Resolver get template file name test
  *
  * @return void
  */
 public function testGetTemplateFileName()
 {
     $template = 'template.phtml';
     $this->_viewFileSystemMock->expects($this->once())->method('getTemplateFileName')->with($template)->will($this->returnValue('path_to' . $template));
     $this->assertEquals('path_to' . $template, $this->_resolver->getTemplateFileName($template));
     $this->assertEquals('path_to' . $template, $this->_resolver->getTemplateFileName($template));
 }
 /**
  * @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);
 }
Пример #3
0
 /**
  * Get template filename
  *
  * @param string $template
  * @param [] $params
  * @return string|bool
  */
 public function getTemplateFileName($template, $params = [])
 {
     $key = $template . '_' . serialize($params);
     if (!isset($this->_templateFilesMap[$key])) {
         $this->_templateFilesMap[$key] = $this->_viewFileSystem->getTemplateFileName($template, $params);
     }
     return $this->_templateFilesMap[$key];
 }
Пример #4
0
 public function testRender()
 {
     $template = 'test_template';
     $result = 'result';
     $path = 'path';
     $this->viewInterfaceMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponentInterface');
     $templateEngineMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\TemplateEngineInterface');
     $this->templateEnginePoolMock->expects($this->once())->method('get')->willReturn($templateEngineMock);
     $this->filesystemMock->expects($this->once())->method('getTemplateFileName')->with($template)->willReturn($path);
     $templateEngineMock->expects($this->once())->method('render')->with($this->viewInterfaceMock, $path)->willReturn($result);
     $this->assertEquals($result, $this->html->render($this->viewInterfaceMock, $template));
 }
Пример #5
0
 /**
  * Render data
  *
  * @param UiComponentInterface $view
  * @param string $template
  * @return string
  */
 public function render(UiComponentInterface $view, $template = '')
 {
     $templateEngine = false;
     if ($template) {
         $extension = pathinfo($template, PATHINFO_EXTENSION);
         $templateEngine = $this->templateEnginePool->get($extension);
     }
     if ($templateEngine) {
         $path = $this->filesystem->getTemplateFileName($template);
         $result = $templateEngine->render($view, $path);
     } else {
         $result = '';
     }
     return $result;
 }
Пример #6
0
 /**
  * Render data
  *
  * @param UiComponentInterface $view
  * @param string $template
  * @return string
  * @throws \Exception
  */
 public function render(UiComponentInterface $view, $template = '')
 {
     $templateEngine = false;
     if ($template) {
         $extension = pathinfo($template, PATHINFO_EXTENSION);
         $templateEngine = $this->templateEnginePool->get($extension);
     }
     if ($templateEngine) {
         $path = $this->filesystem->getTemplateFileName($template);
         $result = $templateEngine->render($view, $path);
     } else {
         $result = $this->getDataXml($view);
     }
     throw new \Exception('Please implement XML renderer');
 }
 /**
  * Scan references to files from other static files and assert they are correct
  *
  * The CSS or LESS files may refer to other resources using @import or url() notation
  * We want to check integrity of all these references
  * Note that the references may have syntax specific to the Magento preprocessing subsystem
  *
  * @param string $area
  * @param string $themePath
  * @param string $locale
  * @param string $module
  * @param string $filePath
  * @param string $absolutePath
  * @dataProvider referencesFromStaticFilesDataProvider
  */
 public function testReferencesFromStaticFiles($area, $themePath, $locale, $module, $filePath, $absolutePath)
 {
     $contents = file_get_contents($absolutePath);
     preg_match_all(\Magento\Framework\View\Url\CssResolver::REGEX_CSS_RELATIVE_URLS, $contents, $matches);
     foreach ($matches[1] as $relatedResource) {
         if (false !== strpos($relatedResource, '@')) {
             // unable to parse paths with LESS variables/mixins
             continue;
         }
         list($relatedModule, $relatedPath) = \Magento\Framework\View\Asset\Repository::extractModule($relatedResource);
         if ($relatedModule) {
             $fallbackModule = $relatedModule;
         } else {
             if ('less' == pathinfo($filePath, PATHINFO_EXTENSION)) {
                 /**
                  * The LESS library treats the related resources with relative links not in the same way as CSS:
                  * when another LESS file is included, it is embedded directly into the resulting document, but the
                  * relative paths of related resources are not adjusted accordingly to the new root file.
                  * Probably it is a bug of the LESS library.
                  */
                 $this->markTestSkipped("Due to LESS library specifics, the '{$relatedResource}' cannot be tested.");
             }
             $fallbackModule = $module;
             $relatedPath = \Magento\Framework\View\FileSystem::getRelatedPath($filePath, $relatedResource);
         }
         // the $relatedPath will be suitable for feeding to the fallback system
         $this->assertNotEmpty($this->getStaticFile($area, $themePath, $locale, $relatedPath, $fallbackModule), "The related resource cannot be resolved through fallback: '{$relatedResource}'");
     }
 }
Пример #8
0
 /**
  * @param string $area
  * @param bool $forceReload
  * @param array $cachedData
  * @dataProvider dataProviderForTestLoadData
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function testLoadData($area, $forceReload, $cachedData)
 {
     $this->expectsSetConfig('themeId');
     $this->cache->expects($this->exactly($forceReload ? 0 : 1))->method('load')->will($this->returnValue(serialize($cachedData)));
     if (!$forceReload && $cachedData !== false) {
         $this->translate->loadData($area, $forceReload);
         $this->assertEquals($cachedData, $this->translate->getData());
         return;
     }
     $this->directory->expects($this->any())->method('isExist')->will($this->returnValue(true));
     // _loadModuleTranslation()
     $this->moduleList->expects($this->once())->method('getNames')->will($this->returnValue(['name']));
     $moduleData = ['module original' => 'module translated', 'module theme' => 'module-theme original translated', 'module pack' => 'module-pack original translated', 'module db' => 'module-db original translated'];
     $this->modulesReader->expects($this->any())->method('getModuleDir')->will($this->returnValue('/app/module'));
     $themeData = ['theme original' => 'theme translated', 'module theme' => 'theme translated overwrite', 'module pack' => 'theme-pack translated overwrite', 'module db' => 'theme-db translated overwrite'];
     $this->csvParser->expects($this->any())->method('getDataPairs')->will($this->returnValueMap([['/app/module/en_US.csv', 0, 1, $moduleData], ['/app/module/en_GB.csv', 0, 1, $moduleData], ['/theme.csv', 0, 1, $themeData]]));
     // _loadThemeTranslation()
     $this->viewFileSystem->expects($this->any())->method('getLocaleFileName')->will($this->returnValue('/theme.csv'));
     // _loadPackTranslation
     $packData = ['pack original' => 'pack translated', 'module pack' => 'pack translated overwrite', 'module db' => 'pack-db translated overwrite'];
     $this->packDictionary->expects($this->once())->method('getDictionary')->will($this->returnValue($packData));
     // _loadDbTranslation()
     $dbData = ['db original' => 'db translated', 'module db' => 'db translated overwrite'];
     $this->resource->expects($this->any())->method('getTranslationArray')->will($this->returnValue($dbData));
     $this->cache->expects($this->exactly(1))->method('save');
     $this->translate->loadData($area, $forceReload);
     $expected = ['module original' => 'module translated', 'module theme' => 'theme translated overwrite', 'module pack' => 'pack translated overwrite', 'module db' => 'db translated overwrite', 'theme original' => 'theme translated', 'pack original' => 'pack translated', 'db original' => 'db translated'];
     $this->assertEquals($expected, $this->translate->getData());
 }
Пример #9
0
 /**
  * Retrieve translation file for theme
  *
  * @param string $locale
  * @return string
  */
 protected function _getThemeTranslationFile($locale)
 {
     return $this->_viewFileSystem->getLocaleFileName(
         'i18n' . '/' . $locale . '.csv',
         ['area' => $this->getConfig('area')]
     );
 }
Пример #10
0
    /**
     * Render view config object for current package and theme
     *
     * @param array $params
     * @return \Magento\Framework\Config\View
     */
    public function getViewConfig(array $params = [])
    {
        $this->assetRepo->updateDesignParams($params);
        /** @var $currentTheme \Magento\Framework\View\Design\ThemeInterface */
        $currentTheme = $params['themeModel'];
        $key = $currentTheme->getCode();
        if (isset($this->viewConfigs[$key])) {
            return $this->viewConfigs[$key];
        }

        $configFiles = $this->moduleReader->getConfigurationFiles(basename($this->filename))->toArray();
        $themeConfigFile = $currentTheme->getCustomization()->getCustomViewConfigPath();
        if (empty($themeConfigFile)
            || !$this->rootDirectory->isExist($this->rootDirectory->getRelativePath($themeConfigFile))
        ) {
            $themeConfigFile = $this->viewFileSystem->getFilename($this->filename, $params);
        }
        if ($themeConfigFile
            && $this->rootDirectory->isExist($this->rootDirectory->getRelativePath($themeConfigFile))
        ) {
            $configFiles[$this->rootDirectory->getRelativePath($themeConfigFile)] = $this->rootDirectory->readFile(
                $this->rootDirectory->getRelativePath($themeConfigFile)
            );
        }
        $config = $this->viewFactory->create($configFiles);

        $this->viewConfigs[$key] = $config;
        return $config;
    }
Пример #11
0
 /**
  * Generate layout update xml
  *
  * @param string $container
  * @param string $templatePath
  * @return string
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function generateLayoutUpdateXml($container, $templatePath = '')
 {
     $templateFilename = $this->_viewFileSystem->getTemplateFileName($templatePath, ['area' => $this->getArea(), 'themeId' => $this->getThemeId(), 'module' => \Magento\Framework\View\Element\AbstractBlock::extractModuleName($this->getType())]);
     if (!$this->getId() && !$this->isCompleteToCreate() || $templatePath && !is_readable($templateFilename)) {
         return '';
     }
     $parameters = $this->getWidgetParameters();
     $xml = '<body><referenceContainer name="' . $container . '">';
     $template = '';
     if (isset($parameters['template'])) {
         unset($parameters['template']);
     }
     if ($templatePath) {
         $template = ' template="' . $templatePath . '"';
     }
     $hash = $this->mathRandom->getUniqueHash();
     $xml .= '<block class="' . $this->getType() . '" name="' . $hash . '"' . $template . '>';
     foreach ($parameters as $name => $value) {
         if ($name == 'conditions') {
             $name = 'conditions_encoded';
             $value = $this->conditionsHelper->encode($value);
         } elseif (is_array($value)) {
             $value = implode(',', $value);
         }
         if ($name && strlen((string) $value)) {
             $xml .= '<action method="setData">' . '<argument name="name" xsi:type="string">' . $name . '</argument>' . '<argument name="value" xsi:type="string">' . $this->_escaper->escapeHtml($value) . '</argument>' . '</action>';
         }
     }
     $xml .= '</block></referenceContainer></body>';
     return $xml;
 }
Пример #12
0
 /**
  * Adjust relative URLs in CSS content as if the file with this content is to be moved to new location
  *
  * @param string $cssContent
  * @param string $relatedPath
  * @param string $filePath
  * @return mixed
  */
 public function relocateRelativeUrls($cssContent, $relatedPath, $filePath)
 {
     $offset = FileSystem::offsetPath($relatedPath, $filePath);
     $callback = function ($path) use($offset) {
         return FileSystem::normalizePath($offset . '/' . $path);
     };
     return $this->replaceRelativeUrls($cssContent, $callback);
 }
Пример #13
0
 public function testGetWidgetSupportedTemplatesByContainersUnknownContainer()
 {
     $expectedConfigFile = __DIR__ . '/../_files/mappedConfigArray1.php';
     $widget = (include $expectedConfigFile);
     $this->_widgetModelMock->expects($this->once())->method('getWidgetByClassType')->will($this->returnValue($widget));
     $this->_viewFileSystemMock->expects($this->once())->method('getFilename')->will($this->returnValue(''));
     $expectedTemplates = [];
     $this->assertEquals($expectedTemplates, $this->_model->getWidgetSupportedTemplatesByContainer('unknown'));
 }
Пример #14
0
 public function testToHtmlWithoutRatingData()
 {
     $this->registry->expects($this->any())->method('registry')->will($this->returnValue(false));
     $this->systemStore->expects($this->any())->method('getStoreCollection')->will($this->returnValue(['0' => $this->store]));
     $this->formFactory->expects($this->any())->method('create')->will($this->returnValue($this->form));
     $this->viewFileSystem->expects($this->any())->method('getTemplateFileName')->will($this->returnValue('template_file_name.html'));
     $this->fileSystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($this->directoryReadInterface));
     $this->block->toHtml();
 }
Пример #15
0
 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);
 }
Пример #16
0
 /**
  * Get absolute path to template
  *
  * @param string|null $template
  * @return string
  */
 public function getTemplateFile($template = null)
 {
     $params = ['module' => $this->getModuleName()];
     $area = $this->getArea();
     if ($area) {
         $params['area'] = $area;
     }
     $templateName = $this->_viewFileSystem->getTemplateFileName($template ?: $this->getTemplate(), $params);
     return $templateName;
 }
Пример #17
0
 /**
  * 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);
 }
Пример #18
0
 /**
  * Convert module notation to a path relative to the specified asset
  *
  * For example, the asset is Foo_Bar/styles/style.css and it refers to Bar_Baz::images/logo.gif
  * (i.e. url(Bar_Baz::images/logo.gif))
  * The result will be ../../Bar_Baz/images/logo.gif
  *
  * @param Asset\LocalInterface $thisAsset
  * @param string $relatedFileId
  * @return string
  */
 public function convertModuleNotationToPath(Asset\LocalInterface $thisAsset, $relatedFileId)
 {
     if (false === strpos($relatedFileId, Asset\Repository::FILE_ID_SEPARATOR)) {
         return $relatedFileId;
     }
     $thisPath = $thisAsset->getPath();
     $relatedAsset = $this->assetRepo->createSimilar($relatedFileId, $thisAsset);
     $relatedPath = $relatedAsset->getPath();
     $offset = FileSystem::offsetPath($relatedPath, $thisPath);
     return FileSystem::normalizePath($offset . '/' . basename($relatedPath));
 }
Пример #19
0
 public function testGetViewConfig()
 {
     $themeMock = $this->getMock('Magento\\Theme\\Model\\Theme', ['getId', 'getCustomization', 'getCustomViewConfigPath'], [], '', false);
     $themeMock->expects($this->atLeastOnce())->method('getId')->will($this->returnValue(2));
     $themeMock->expects($this->once())->method('getCustomization')->will($this->returnSelf());
     $themeMock->expects($this->once())->method('getCustomViewConfigPath')->will($this->returnValue(''));
     $params = ['themeModel' => $themeMock];
     $configFile = 'config.xml';
     $this->repositoryMock->expects($this->atLeastOnce())->method('updateDesignParams')->with($this->equalTo($params))->will($this->returnSelf());
     $iterator = $this->getMock('Magento\\Framework\\Config\\FileIterator', [], [], '', false);
     $iterator->expects($this->once())->method('toArray')->will($this->returnValue([]));
     $this->readerMock->expects($this->once())->method('getConfigurationFiles')->with($this->equalTo(basename(\Magento\Framework\View\ConfigInterface::CONFIG_FILE_NAME)))->will($this->returnValue($iterator));
     $this->directoryReadMock->expects($this->once())->method('isExist')->with($this->anything())->will($this->returnValue(true));
     $this->fileSystemMock->expects($this->once())->method('getFilename')->with($this->equalTo(\Magento\Framework\View\ConfigInterface::CONFIG_FILE_NAME), $params)->will($this->returnValue($configFile));
     $this->directoryReadMock->expects($this->any())->method('getRelativePath')->with($this->equalTo($configFile))->will($this->returnArgument(0));
     $xmlData = '<view><vars module="Magento_Catalog"><var name="test">1</var></vars></view>';
     $this->directoryReadMock->expects($this->once())->method('readFile')->with($this->equalTo($configFile))->will($this->returnValue($xmlData));
     $this->assertInstanceOf('Magento\\Framework\\Config\\View', $this->config->getViewConfig($params));
     // lazy load test
     $this->assertInstanceOf('Magento\\Framework\\Config\\View', $this->config->getViewConfig($params));
 }
Пример #20
0
 protected function setUp()
 {
     $this->_viewFileSystem = $this->getMock('Magento\\Framework\\View\\FileSystem', array('getLocaleFileName', 'getDesignTheme'), array(), '', false);
     $this->_viewFileSystem->expects($this->any())->method('getLocaleFileName')->will($this->returnValue(dirname(__DIR__) . '/Core/Model/_files/design/frontend/test_default/i18n/en_US.csv'));
     $theme = $this->getMock('\\Magento\\Framework\\View\\Design\\ThemeInterface', array());
     $theme->expects($this->any())->method('getId')->will($this->returnValue(10));
     $this->_viewFileSystem->expects($this->any())->method('getDesignTheme')->will($this->returnValue($theme));
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $objectManager->addSharedInstance($this->_viewFileSystem, 'Magento\\Framework\\View\\FileSystem');
     /** @var $moduleReader \Magento\Framework\Module\Dir\Reader */
     $moduleReader = $objectManager->get('Magento\\Framework\\Module\\Dir\\Reader');
     $moduleReader->setModuleDir('Magento_Core', 'i18n', dirname(__DIR__) . '/Core/Model/_files/Magento/Core/i18n');
     $moduleReader->setModuleDir('Magento_Catalog', 'i18n', dirname(__DIR__) . '/Core/Model/_files/Magento/Catalog/i18n');
     /** @var \Magento\Core\Model\View\Design _designModel */
     $this->_designModel = $this->getMock('Magento\\Core\\Model\\View\\Design', array('getDesignTheme'), array($objectManager->get('Magento\\Framework\\StoreManagerInterface'), $objectManager->get('Magento\\Framework\\View\\Design\\Theme\\FlyweightFactory'), $objectManager->get('Magento\\Framework\\App\\Config\\ScopeConfigInterface'), $objectManager->get('Magento\\Core\\Model\\ThemeFactory'), $objectManager->get('Magento\\Framework\\Locale\\ResolverInterface'), $objectManager->get('Magento\\Framework\\App\\State'), array('frontend' => 'test_default')));
     $this->_designModel->expects($this->any())->method('getDesignTheme')->will($this->returnValue($theme));
     $objectManager->addSharedInstance($this->_designModel, 'Magento\\Core\\Model\\View\\Design\\Proxy');
     $this->_model = $objectManager->create('Magento\\Framework\\Translate');
     $objectManager->addSharedInstance($this->_model, 'Magento\\Framework\\Translate');
     $objectManager->removeSharedInstance('Magento\\Framework\\Phrase\\Renderer\\Composite');
     $objectManager->removeSharedInstance('Magento\\Framework\\Phrase\\Renderer\\Translate');
     \Magento\Framework\Phrase::setRenderer($objectManager->get('Magento\\Framework\\Phrase\\RendererInterface'));
     $this->_model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND);
 }
Пример #21
0
 /**
  * Render page template
  *
  * @return string
  * @throws \Exception
  */
 protected function renderPage()
 {
     $fileName = $this->viewFileSystem->getTemplateFileName($this->template);
     if (!$fileName) {
         throw new \InvalidArgumentException('Template "' . $this->template . '" is not found');
     }
     ob_start();
     try {
         extract($this->viewVars, EXTR_SKIP);
         include $fileName;
     } catch (\Exception $exception) {
         ob_end_clean();
         throw $exception;
     }
     $output = ob_get_clean();
     return $output;
 }
Пример #22
0
 /**
  * Ensure that the getTemplateFilename method can be called without design params
  */
 public function testGetTemplateFilenameWithNoParams()
 {
     $this->viewFileSystem->expects($this->once())->method('getEmailTemplateFileName')->with('one.html', ['area' => $this->designParams['area'], 'module' => $this->designParams['module']], 'Fixture_ModuleOne')->will($this->returnValue('_files/Fixture/ModuleOne/view/frontend/email/one.html'));
     $actualResult = $this->model->getTemplateFilename('template_one');
     $this->assertEquals('_files/Fixture/ModuleOne/view/frontend/email/one.html', $actualResult);
 }
Пример #23
0
 /**
  * @param string $relatedPath
  * @param string $path
  * @param string $expectedResult
  * @dataProvider offsetPathDataProvider
  */
 public function testOffsetPath($relatedPath, $path, $expectedResult)
 {
     $result = $this->_model->offsetPath($relatedPath, $path);
     $this->assertEquals($expectedResult, $result);
 }
Пример #24
0
 /**
  * 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;
 }
Пример #25
0
 /**
  * Create a file asset with path relative to specified local asset
  *
  * @param string $fileId
  * @param LocalInterface $relativeTo
  * @return File
  */
 public function createRelated($fileId, LocalInterface $relativeTo)
 {
     list($module, $filePath) = self::extractModule($fileId);
     if ($module) {
         return $this->createSimilar($fileId, $relativeTo);
     }
     $filePath = \Magento\Framework\View\FileSystem::getRelatedPath($relativeTo->getFilePath(), $filePath);
     return $this->createSimilar($filePath, $relativeTo);
 }
Пример #26
0
 /**
  * @dataProvider getFilenameDataProvider
  * @magentoAppIsolation enabled
  */
 public function testGetFilename($file, $params)
 {
     $this->_emulateFixtureTheme();
     $this->assertFileExists($this->_viewFileSystem->getFilename($file, $params));
 }
Пример #27
0
 public function testGetTemplateFile()
 {
     $params = array('module' => 'Fixture_Module', 'area' => 'frontend');
     $this->_viewFileSystem->expects($this->once())->method('getTemplateFileName')->with('template.phtml', $params);
     $this->_block->getTemplateFile();
 }