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


PHP Config::addRemotePageAsset方法代码示例

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


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

示例1: prepareFavicon

 /**
  * @return void
  */
 public function prepareFavicon()
 {
     if ($this->pageConfig->getFaviconFile()) {
         $this->pageConfig->addRemotePageAsset($this->pageConfig->getFaviconFile(), Generator\Head::VIRTUAL_CONTENT_TYPE_LINK, ['attributes' => ['rel' => 'icon', 'type' => 'image/x-icon']], 'icon');
         $this->pageConfig->addRemotePageAsset($this->pageConfig->getFaviconFile(), Generator\Head::VIRTUAL_CONTENT_TYPE_LINK, ['attributes' => ['rel' => 'shortcut icon', 'type' => 'image/x-icon']], 'shortcut-icon');
     } else {
         $this->pageConfig->addPageAsset($this->pageConfig->getDefaultFavicon(), ['attributes' => ['rel' => 'icon', 'type' => 'image/x-icon']], 'icon');
         $this->pageConfig->addPageAsset($this->pageConfig->getDefaultFavicon(), ['attributes' => ['rel' => 'shortcut icon', 'type' => 'image/x-icon']], 'shortcut-icon');
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:Renderer.php

示例2: processAssets

 /**
  * Add assets to page config
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageStructure
  * @return $this
  */
 protected function processAssets(Structure $pageStructure)
 {
     foreach ($pageStructure->getAssets() as $name => $data) {
         if (isset($data['src_type']) && in_array($data['src_type'], $this->remoteAssetTypes)) {
             $this->pageConfig->addRemotePageAsset($name, self::VIRTUAL_CONTENT_TYPE_LINK, $this->getAssetProperties($data));
         } else {
             $this->pageConfig->addPageAsset($name, $this->getAssetProperties($data));
         }
     }
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:Head.php

示例3: testAddRemotePageAsset

 /**
  * @param string $url
  * @param string $contentType
  * @param array $properties
  * @param string|null $name
  * @param string $expectedName
  *
  * @dataProvider remotePageAssetDataProvider
  */
 public function testAddRemotePageAsset($url, $contentType, $properties, $name, $expectedName)
 {
     $this->assetRepo->expects($this->once())->method('createRemoteAsset')->with($url, $contentType)->will(
         $this->returnValue($this->remoteAsset)
     );
     $this->pageAssets->expects($this->once())->method('add')->with($expectedName, $this->remoteAsset, $properties);
     $this->assertInstanceOf(
         'Magento\Framework\View\Page\Config',
         $this->model->addRemotePageAsset($url, $contentType, $properties, $name)
     );
 }
开发者ID:robbiereynolds,项目名称:magento2,代码行数:20,代码来源:ConfigTest.php

示例4: addRemotePageAsset

 /**
  * {@inheritdoc}
  */
 public function addRemotePageAsset($url, $contentType, array $properties = array(), $name = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'addRemotePageAsset');
     if (!$pluginInfo) {
         return parent::addRemotePageAsset($url, $contentType, $properties, $name);
     } else {
         return $this->___callPlugins('addRemotePageAsset', func_get_args(), $pluginInfo);
     }
 }
开发者ID:CSYE6225,项目名称:UnixSysProgramming,代码行数:12,代码来源:Interceptor.php


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