当前位置: 首页>>代码示例>>PHP>>正文


PHP Repository::updateDesignParams方法代码示例

本文整理汇总了PHP中Magento\Framework\View\Asset\Repository::updateDesignParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::updateDesignParams方法的具体用法?PHP Repository::updateDesignParams怎么用?PHP Repository::updateDesignParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\View\Asset\Repository的用法示例。


在下文中一共展示了Repository::updateDesignParams方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getViewConfig

 /**
  * 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];
     }
     $config = $this->viewConfigFactory->create();
     $this->viewConfigs[$key] = $config;
     return $config;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:19,代码来源:Config.php

示例2: getViewConfig

    /**
     * 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;
    }
开发者ID:nblair,项目名称:magescotch,代码行数:35,代码来源:Config.php

示例3: getStaticFileName

 /**
  * Find a static view file using fallback mechanism
  *
  * @param string $fileId
  * @param array $params
  * @return string
  */
 public function getStaticFileName($fileId, array $params = [])
 {
     list($module, $filePath) = \Magento\Framework\View\Asset\Repository::extractModule($this->normalizePath($fileId));
     if ($module) {
         $params['module'] = $module;
     }
     $this->_assetRepo->updateDesignParams($params);
     return $this->_staticFileResolution->getFile($params['area'], $params['themeModel'], $params['locale'], $filePath, $params['module']);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:FileSystem.php

示例4: getViewConfig

 /**
  * 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);
     $viewConfigParams = [];
     if (isset($params['themeModel'])) {
         /** @var \Magento\Framework\View\Design\ThemeInterface $currentTheme */
         $currentTheme = $params['themeModel'];
         $key = $currentTheme->getCode();
         if (isset($this->viewConfigs[$key])) {
             return $this->viewConfigs[$key];
         }
         $viewConfigParams['themeModel'] = $currentTheme;
     }
     $viewConfigParams['area'] = isset($params['area']) ? $params['area'] : null;
     /** @var \Magento\Framework\Config\View $config */
     $config = $this->viewConfigFactory->create($viewConfigParams);
     if (isset($key)) {
         $this->viewConfigs[$key] = $config;
     }
     return $config;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:27,代码来源:Config.php

示例5: getEmailTemplateFileName

 /**
  * Get an email template file
  *
  * @param string $fileId
  * @param array $params
  * @param string $module
  * @return string|bool
  */
 public function getEmailTemplateFileName($fileId, array $params, $module)
 {
     $this->_assetRepo->updateDesignParams($params);
     return $this->_emailTemplateFileResolution->getFile($params['area'], $params['themeModel'], $params['locale'], $fileId, $module);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:FileSystem.php

示例6: testUpdateDesignParamsWrongTheme

 /**
  * @expectedException \UnexpectedValueException
  * @expectedExceptionMessage Could not find theme 'nonexistent_theme' for area 'area'
  */
 public function testUpdateDesignParamsWrongTheme()
 {
     $params = ['area' => 'area', 'theme' => 'nonexistent_theme'];
     $this->themeList->expects($this->once())->method('getThemeByFullPath')->with('area/nonexistent_theme')->will($this->returnValue(null));
     $this->object->updateDesignParams($params);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:10,代码来源:RepositoryTest.php

示例7: testUpdateDesignParams

 /**
  * @param array $params
  * @param array $result
  * @return void
  * @dataProvider updateDesignParamsDataProvider
  */
 public function testUpdateDesignParams($params, $result)
 {
     $this->themeProvider->expects($this->any())->method('getThemeByFullPath')->willReturn('ThemeID');
     $this->repository->updateDesignParams($params);
     $this->assertEquals($result, $params);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:12,代码来源:RepositoryTest.php


注:本文中的Magento\Framework\View\Asset\Repository::updateDesignParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。