當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Renderer\AbstractRenderer類代碼示例

本文整理匯總了PHP中Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractRenderer類的具體用法?PHP AbstractRenderer怎麽用?PHP AbstractRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AbstractRenderer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testRender

 /**
  * @param bool $editable
  * @param bool $onlyEdit
  * @param string $expectedResult
  * @return void
  * @dataProvider renderDataProvider
  */
 public function testRender($editable, $onlyEdit, $expectedResult)
 {
     $value = 'some value';
     $keyValue = 'key';
     $this->columnMock->expects($this->once())->method('getEditable')->willReturn($editable);
     $this->columnMock->expects($this->any())->method('getEditOnly')->willReturn($onlyEdit);
     $this->columnMock->expects($this->any())->method('getIndex')->willReturn($keyValue);
     $this->columnMock->expects($this->any())->method('getId')->willReturn('test');
     $this->dataObjectMock->expects($this->any())->method('getData')->with($keyValue)->willReturn($value);
     $this->renderer->setColumn($this->columnMock);
     $this->assertEquals($expectedResult, $this->renderer->render($this->dataObjectMock));
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:19,代碼來源:AbstractRendererTest.php

示例2: __construct

 /**
  * @param \Magento\Backend\Block\Context                      $context
  * @param \Magento\Framework\Filesystem                       $filesystem
  * @param \Magento\Framework\Filesystem\Directory\ReadFactory $directoryRead
  * @param \Magento\Framework\Stdlib\DateTime\DateTime         $coreDate
  * @param array                                               $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Filesystem\Directory\ReadFactory $directoryRead, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_ioRead = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::ROOT);
     $this->_coreDate = $coreDate;
     $this->_directoryRead = $directoryRead->create("");
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:14,代碼來源:Status.php

示例3: __construct

 /**
  * constructor
  *
  * @param Settings $settings
  * @param Filesystem $filesystem
  * @param Decoder $decoder
  * @param Downloader $downloader
  * @param Context $context
  * @param array $data
  */
 public function __construct(Settings $settings, Filesystem $filesystem, Decoder $decoder, Downloader $downloader, Context $context, array $data = [])
 {
     $this->settings = $settings;
     $this->filesystem = $filesystem;
     $this->decoder = $decoder;
     $this->downloader = $downloader;
     parent::__construct($context, $data);
 }
開發者ID:nhc,項目名稱:Umc_Base,代碼行數:18,代碼來源:Download.php

示例4: render

 /**
  * Renders grid column
  *
  * @param \Magento\Framework\Object $row
  * @return string
  */
 public function render(\Magento\Framework\Object $row)
 {
     $line = parent::_getValue($row);
     $wrappedLine = '';
     $lineLength = $this->getColumn()->getData('lineLength') ? $this->getColumn()->getData('lineLength') : $this->_defaultMaxLineLength;
     for ($i = 0, $n = floor($this->string->strlen($line) / $lineLength); $i <= $n; $i++) {
         $wrappedLine .= $this->string->substr($line, $lineLength * $i, $lineLength) . "<br />";
     }
     return $wrappedLine;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:16,代碼來源:Wrapline.php

示例5: render

 /**
  * Renders grid column
  *
  * @param   \Magento\Framework\DataObject $row
  * @return  string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $encodedUrl = $this->_urlHelper->getEncodedUrl();
     if (!$row->getIsRead()) {
         return sprintf('<a href="%s">%s</a> | <a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>', $this->getUrl('*/*/markAsRead/', ['_current' => true, 'id' => $row->getId()]), __('Mark as Read'), $this->getUrl('*/*/remove/', ['_current' => true, 'id' => $row->getId(), \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl]), __('Are you sure?'), __('Remove'));
     } else {
         return sprintf('<a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>', $this->getUrl('*/*/remove/', ['_current' => true, 'id' => $row->getId(), \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl]), __('Are you sure?'), __('Remove'));
     }
     return parent::render($row);
 }
開發者ID:shipperhq,項目名稱:module-logger,代碼行數:16,代碼來源:Actions.php

示例6: _getValue

 /**
  * @param \Magento\Framework\DataObject $row
  * @return int|string
  */
 protected function _getValue(\Magento\Framework\DataObject $row)
 {
     $data = parent::_getValue($row);
     if (intval($data) == $data) {
         return (string) number_format($data, 2);
     }
     if ($data !== null) {
         return $data * 1;
     }
     return $this->getColumn()->getDefault();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:Data.php

示例7: render

 /**
  * Render contents as a long text
  *
  * Text will be truncated as specified in string_limit, truncate or 250 by default
  * Also it can be html-escaped and nl2br()
  *
  * @param \Magento\Framework\Object $row
  * @return string
  */
 public function render(\Magento\Framework\Object $row)
 {
     $truncateLength = 250;
     // stringLength() is for legacy purposes
     if ($this->getColumn()->getStringLimit()) {
         $truncateLength = $this->getColumn()->getStringLimit();
     }
     if ($this->getColumn()->getTruncate()) {
         $truncateLength = $this->getColumn()->getTruncate();
     }
     $text = $this->filterManager->truncate(parent::_getValue($row), ['length' => $truncateLength]);
     if ($this->getColumn()->getEscape()) {
         $text = $this->escapeHtml($text);
     }
     if ($this->getColumn()->getNl2br()) {
         $text = nl2br($text);
     }
     return $text;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:28,代碼來源:Longtext.php

示例8: _getValue

 /**
  * Renders grid column
  *
  * @param \Magento\Framework\DataObject $row
  * @return mixed
  */
 public function _getValue(\Magento\Framework\DataObject $row)
 {
     $format = $this->getColumn()->getFormat() ? $this->getColumn()->getFormat() : null;
     $defaultValue = $this->getColumn()->getDefault();
     if ($format === null) {
         // If no format and it column not filtered specified return data as is.
         $data = parent::_getValue($row);
         $string = $data === null ? $defaultValue : $data;
         return $this->escapeHtml($string);
     } elseif (preg_match_all($this->_variablePattern, $format, $matches)) {
         // Parsing of format string
         $formattedString = $format;
         foreach ($matches[0] as $matchIndex => $match) {
             $value = $row->getData($matches[1][$matchIndex]);
             $formattedString = str_replace($match, $value, $formattedString);
         }
         return $formattedString;
     } else {
         return $this->escapeHtml($format);
     }
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:27,代碼來源:Text.php

示例9: __construct

 /**
  * @param \Magento\Backend\Block\Context $context
  * @param \Magento\Framework\Registry $registry
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Framework\Registry $registry, array $data = [])
 {
     $this->_coreRegistry = $registry;
     parent::__construct($context, $data);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:10,代碼來源:Action.php

示例10: __construct

 /**
  * @param \Magento\Backend\Block\Context $context
  * @param \Magento\Framework\Url\Helper\Data $urlHelper
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Framework\Url\Helper\Data $urlHelper, array $data = [])
 {
     $this->_urlHelper = $urlHelper;
     parent::__construct($context, $data);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:10,代碼來源:Actions.php

示例11: __construct

 public function __construct(\Magento\Backend\Block\Context $context, \Foggyline\Helpdesk\Model\TicketFactory $ticketFactory, array $data = [])
 {
     parent::__construct($context, $data);
     $this->ticketFactory = $ticketFactory;
 }
開發者ID:ksz2013,項目名稱:B05032-Foggyline_Helpdesk,代碼行數:5,代碼來源:Severity.php

示例12: __construct

 /**
  * @param \Magento\Backend\Block\Context $context
  * @param \Magento\Store\Model\System\Store $systemStore
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Store\Model\System\Store $systemStore, array $data = array())
 {
     $this->_systemStore = $systemStore;
     parent::__construct($context, $data);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:10,代碼來源:Store.php

示例13: renderCss

 /**
  * Renders CSS
  *
  * @return string
  */
 public function renderCss()
 {
     return parent::renderCss() . ' col-number';
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:9,代碼來源:Number.php

示例14: __construct

 /**
  * @param \Magento\Backend\Block\Context $context
  * @param \Magento\Framework\Stdlib\DateTime\DateTime $date
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, array $data = [])
 {
     $this->_date = $date;
     parent::__construct($context, $data);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:10,代碼來源:Time.php

示例15: __construct

 /**
  * @param \Magento\Backend\Block\Context $context
  * @param \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter, array $data = array())
 {
     parent::__construct($context, $data);
     $this->_converter = $converter;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:10,代碼來源:Radio.php


注:本文中的Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。