public function getPlaceholders(BlockInterface $block) { if ($block instanceof DocumentBlock) { $view = $this->getView(); } else { $service = $this->blockManager->getService($block); if ($service instanceof LayoutBlockServiceInterface) { return $service->getPlaceholders($block); } $view = $service->getView($block); } return $this->twigAnalyzer->findPlaceholders($view); }
public function getPlaceholders($object) { if ($object instanceof Content || $object instanceof Template) { $view = $this->getView(); } else { $service = $this->blockManager->getService($object); if ($service instanceof LayoutBlockServiceInterface) { return $service->getPlaceholders($object); } $view = $service->getView($object); } return $this->twigAnalyzer->findPlaceholders($view); }
/** * @inheritDoc */ public function getTool(BlockInterface $block = null) { $tools = array(); foreach ($this->getClipboardBlocks() as $block) { /** @var ToolsetMemberInterface $copyService */ $copyService = $this->blockManager->getService($block); $copyTool = $copyService->getTool($block); $tool = new Tool($copyTool->getName(), 'clipboard'); $tool->setGroup('Clipboard'); $tool->setIcon($copyTool->getIcon()); $tool->setData(['id' => $block->getId()]); $title = $block->getOwner() instanceof Content ? $block->getOwner()->getTitle() : $block->getOwner()->getName(); $tool->setDescription(sprintf('<span class="material-icons md-18">swap_horz</span> %s', $title)); $tools[] = $tool; } return $tools; }
public function getReferenceService(BlockInterface $block) { return $this->blockManager->getService($block->getReference()->getBlockType()); }