當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。