/** * render skin * * @return \Illuminate\View\View */ public function renderSkin() { $request = $this->presenter->getRequest(); if ($request instanceof \Xpressengine\Http\Request) { $isMobile = $request->isMobile(); } else { $isMobile = false; } $instanceConfig = $this->presenter->getInstanceConfig(); $skinHandler = $this->presenter->getSkinHandler(); $viewFactory = $this->presenter->getViewFactory(); $instanceId = $instanceConfig->getInstanceId(); $skinName = $this->presenter->getSkin(); $id = $this->presenter->getId(); $skinView = null; if ($skinName != null && is_string($skinName)) { if ($this->presenter->getIsSettings()) { $skin = $skinHandler->getAssignedSettings($skinName); } else { $skin = $skinHandler->getAssigned([$skinName, $instanceId], $isMobile ? 'mobile' : 'desktop'); } if ($skin === null) { throw new NotFoundSkinException(); } $skinView = $skin->setView($id)->setData($this->data)->render(); } else { $skinView = $viewFactory->make($id, $this->data); } return $skinView; }