![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/aheadworks/module-csblock/Ui/Component/Listing/Columns/ |
<?php namespace Aheadworks\Csblock\Ui\Component\Listing\Columns; use Magento\Framework\View\Element\UiComponentFactory; use Magento\Framework\View\Element\UiComponent\ContextInterface; /** * Class \Aheadworks\Csblock\Ui\Component\Listing\Columns\Name */ class Name extends \Magento\Ui\Component\Listing\Columns\Column { protected $_filterManager; public function __construct( \Magento\Framework\Filter\FilterManager $filterManager, ContextInterface $context, UiComponentFactory $uiComponentFactory, array $components = [], array $data = [] ) { parent::__construct($context, $uiComponentFactory, $components, $data); $this->_filterManager = $filterManager; } public function prepareDataSource(array $dataSource) { foreach ($dataSource['data']['items'] as &$item) { $item['name'] = $this->_getLink($item['id'], $item['name']); } return $dataSource; } protected function _getLink($entityId, $name) { $url = $this->context->getUrl('csblock_admin/csblock/edit', ['id' => $entityId]); return '<a href="' . $url . '" target="_blank" onclick="setLocation(this.href)">' . $name . '</a>'; } }