• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Renderer\AbstractRenderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer的典型用法代码示例。如果您正苦于以下问题:PHP AbstractRenderer类的具体用法?PHP AbstractRenderer怎么用?PHP AbstractRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了AbstractRenderer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: __construct

 public function __construct(\Magento\Backend\Block\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Tuna\BannerSlider\Model\BannerFactory $bannerFactory, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_storeManager = $storeManager;
     $this->_bannerFactory = $bannerFactory;
 }
开发者ID:mrtuvn,项目名称:m2ce.dev,代码行数:6,代码来源:Image.php


示例17: renderHeader

 /**
  * Renders header of the column
  *
  * @return string
  */
 public function renderHeader()
 {
     if ($this->getColumn()->getHeader()) {
         return parent::renderHeader();
     }
     $checked = '';
     if ($filter = $this->getColumn()->getFilter()) {
         $checked = $filter->getValue() ? ' checked="checked"' : '';
     }
     $disabled = '';
     if ($this->getColumn()->getDisabled()) {
         $disabled = ' disabled="disabled"';
     }
     $html = '<th class="data-grid-th data-grid-actions-cell"><input type="checkbox" ';
     $html .= 'name="' . $this->getColumn()->getFieldName() . '" ';
     $html .= 'onclick="' . $this->getColumn()->getGrid()->getJsObjectName() . '.checkCheckboxes(this)" ';
     $html .= 'class="admin__control-checkbox"' . $checked . $disabled . ' ';
     $html .= 'title="' . __('Select All') . '"/><label></label></th>';
     return $html;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:25,代码来源:Checkbox.php


示例18: __construct

 /**
  * @param \Magento\Backend\Block\Context $context
  * @param \Magento\AdminNotification\Model\Inbox $notice
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Magento\AdminNotification\Model\Inbox $notice, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_notice = $notice;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Severity.php


示例19: __construct

 /**
  * @param \Magento\Backend\Block\Context            $context
  * @param \Wyomind\SimpleGoogleShopping\Helper\Data $sgsHelper
  * @param array                                     $data
  */
 public function __construct(\Magento\Backend\Block\Context $context, \Wyomind\SimpleGoogleShopping\Helper\Data $sgsHelper, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_sgsHelper = $sgsHelper;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:10,代码来源:Link.php


示例20: __construct

 public function __construct(\Magento\Backend\Block\Context $context, \Devopensource\Tickets\Model\TicketFactory $ticketFactory, array $data = [])
 {
     parent::__construct($context, $data);
     $this->ticketFactory = $ticketFactory;
 }
开发者ID:DevopensourceTeam,项目名称:Devopensource_Tickets,代码行数:5,代码来源:Status.php



注:本文中的Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Helper\Data类代码示例发布时间:2022-05-23
下一篇:
PHP Grid\Extended类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap