Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UiComponentTypeResolver.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Ui\Model;
7 
9 
18 {
22  const DEFAULT_CONTENT_TYPE = 'text/html';
23 
27  private $uiComponentTypeMap = [];
28 
32  public function __construct(array $uiComponentTypeMap)
33  {
34  $this->uiComponentTypeMap = $uiComponentTypeMap;
35  }
36 
41  public function resolve(UiComponentContext $componentContext): string
42  {
43  $acceptType = $componentContext->getAcceptType();
44  return $this->uiComponentTypeMap[$acceptType] ?? static::DEFAULT_CONTENT_TYPE;
45  }
46 }
resolve(UiComponentContext $componentContext)