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