当前位置: 首页>>代码示例>>PHP>>正文


PHP Block\Widget类代码示例

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


在下文中一共展示了Widget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _prepareLayout

 /**
  * @return Widget
  */
 protected function _prepareLayout()
 {
     $this->addChild('add_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Add New Option'), 'class' => 'add', 'id' => 'add_new_defined_option'));
     $this->addChild('options_box', 'Magento\\Catalog\\Block\\Adminhtml\\Product\\Edit\\Tab\\Options\\Option');
     $this->addChild('import_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Import Options'), 'class' => 'add', 'id' => 'import_new_defined_option'));
     return parent::_prepareLayout();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Options.php

示例2: _prepareLayout

 /**
  * Prepare layout
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $this->setData('opened', true);
     $this->addChild('add_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Create New Option'), 'class' => 'add', 'id' => 'add_new_option', 'on_click' => 'bOption.add()']);
     $this->setChild('options_box', $this->getLayout()->createBlock('Magento\\Bundle\\Block\\Adminhtml\\Catalog\\Product\\Edit\\Tab\\Bundle\\Option', 'adminhtml.catalog.product.edit.tab.bundle.option'));
     return parent::_prepareLayout();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:12,代码来源:Bundle.php

示例3: _prepareLayout

 /**
  * {@inheritdoc}
  */
 protected function _prepareLayout()
 {
     $this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/') . '\')', 'class' => 'back']);
     if ($this->getDesignChangeId()) {
         $this->getToolbar()->addChild('delete_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Delete'), 'onclick' => 'deleteConfirm(\'' . __('Are you sure?') . '\', \'' . $this->getDeleteUrl() . '\')', 'class' => 'delete']);
     }
     $this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Save'), 'class' => 'save primary', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'save', 'target' => '#design-edit-form']]]]);
     return parent::_prepareLayout();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:Edit.php

示例4: _toHtml

 /**
  * Prepare html output
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!$this->getWidgetTemplates()) {
         $html = '<p class="nm"><small>' . __('Please Select Container First') . '</small></p>';
     } elseif (count($this->getWidgetTemplates()) == 1) {
         $widgetTemplate = current($this->getWidgetTemplates());
         $html = '<input type="hidden" name="template" value="' . $widgetTemplate['value'] . '" />';
         $html .= $widgetTemplate['label'];
     } else {
         $html = $this->getLayout()->createBlock('Magento\\Framework\\View\\Element\\Html\\Select')->setName('template')->setClass('select')->setOptions($this->getWidgetTemplates())->setValue($this->getSelected())->toHtml();
     }
     return parent::_toHtml() . $html;
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:18,代码来源:Template.php

示例5: __construct

 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory
  * @param \Magento\Newsletter\Model\QueueFactory $queueFactory
  * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Newsletter\Model\TemplateFactory $templateFactory, \Magento\Newsletter\Model\QueueFactory $queueFactory, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, array $data = [])
 {
     $this->_templateFactory = $templateFactory;
     $this->_queueFactory = $queueFactory;
     $this->_subscriberFactory = $subscriberFactory;
     parent::__construct($context, $data);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:Preview.php

示例6: _construct

 /**
  * Define block template
  *
  * @return void
  */
 protected function _construct()
 {
     if (!$this->hasTemplate()) {
         $this->setTemplate('Magento_Backend::widget/button/split.phtml');
     }
     parent::_construct();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:SplitButton.php

示例7: _beforeToHtml

 /**
  * Before rendering html, but after trying to load cache
  *
  * @return void
  */
 protected function _beforeToHtml()
 {
     if ($this->getParentBlock() && ($order = $this->getOrder())) {
         $this->setEntity($order);
     }
     parent::_beforeToHtml();
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:Giftmessage.php

示例8: _construct

 /**
  * @return void
  */
 public function _construct()
 {
     if ($this->hasData('grouped')) {
         $this->_isGrouped = (bool) $this->getData('grouped');
     }
     parent::_construct();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Column.php

示例9: _prepareLayout

 /**
  * @return AbstractBlock
  */
 protected function _prepareLayout()
 {
     $this->addChild('uploader', 'Magento\\Backend\\Block\\Media\\Uploader');
     $this->getUploader()->getConfig()->setUrl($this->_urlBuilder->addSessionParam()->getUrl('catalog/product_gallery/upload'))->setFileField('image')->setFilters(['images' => ['label' => __('Images (.gif, .jpg, .png)'), 'files' => ['*.gif', '*.jpg', '*.jpeg', '*.png']]]);
     $this->_eventManager->dispatch('catalog_product_gallery_prepare_layout', ['block' => $this]);
     return parent::_prepareLayout();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Content.php

示例10: __construct

 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Backend\Model\Session\Quote $sessionQuote
  * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate
  * @param PriceCurrencyInterface $priceCurrency
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Backend\Model\Session\Quote $sessionQuote, \Magento\Sales\Model\AdminOrder\Create $orderCreate, PriceCurrencyInterface $priceCurrency, array $data = [])
 {
     $this->priceCurrency = $priceCurrency;
     $this->_sessionQuote = $sessionQuote;
     $this->_orderCreate = $orderCreate;
     parent::__construct($context, $data);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:14,代码来源:AbstractCreate.php

示例11: __construct

 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
  * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory
  * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory
  * @param \Magento\Framework\Registry $registry
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, \Magento\Framework\Registry $registry, array $data = [])
 {
     $this->_jsonEncoder = $jsonEncoder;
     $this->_setFactory = $setFactory;
     $this->_attributeFactory = $attributeFactory;
     $this->_coreRegistry = $registry;
     parent::__construct($context, $data);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:16,代码来源:Created.php

示例12: _construct

 /**
  * Initialize block
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setProductId($this->getRequest()->getParam('id'));
     $this->setId('config_super_product');
     $this->setCanEditPrice(true);
     $this->setCanReadPrice(true);
 }
开发者ID:nja78,项目名称:magento2,代码行数:13,代码来源:Config.php

示例13: __construct

 /**
  * @param \Magento\Backend\Block\Template\Context  $context
  * @param \Magento\Framework\Registry              $coreRegistry
  * @param \Magento\Framework\UrlInterface          $urlBuilder
  * @param \Sebwite\ProductDownloads\Model\Download $download
  * @param ScopeConfigInterface                     $scopeConfig
  * @param array                                    $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\UrlInterface $urlBuilder, \Sebwite\ProductDownloads\Model\Download $download, ScopeConfigInterface $scopeConfig, array $data = [])
 {
     $this->coreRegistry = $coreRegistry;
     $this->download = $download;
     $this->urlBuilder = $urlBuilder;
     $this->scopeConfig = $scopeConfig;
     parent::__construct($context, $data);
 }
开发者ID:BlackIkeEagle,项目名称:Magento2-Product-Downloads,代码行数:16,代码来源:Download.php

示例14: __construct

 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param GroupRepositoryInterface $groupRepository
  * @param \Magento\Directory\Helper\Data $directoryHelper
  * @param \Magento\Framework\Module\Manager $moduleManager
  * @param \Magento\Framework\Registry $registry
  * @param GroupManagementInterface $groupManagement
  * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, GroupRepositoryInterface $groupRepository, \Magento\Directory\Helper\Data $directoryHelper, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\Registry $registry, GroupManagementInterface $groupManagement, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, array $data = [])
 {
     $this->_groupRepository = $groupRepository;
     $this->_directoryHelper = $directoryHelper;
     $this->moduleManager = $moduleManager;
     $this->_coreRegistry = $registry;
     $this->_groupManagement = $groupManagement;
     $this->_searchCriteriaBuilder = $searchCriteriaBuilder;
     parent::__construct($context, $data);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:20,代码来源:AbstractGroup.php

示例15: __construct

 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders
  * @param \Magento\CatalogInventory\Model\Source\Stock $stock
  * @param \Magento\Framework\Module\Manager $moduleManager
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
  * @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Model\Source\Backorders $backorders, \Magento\CatalogInventory\Model\Source\Stock $stock, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\Registry $coreRegistry, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, array $data = [])
 {
     $this->stock = $stock;
     $this->backorders = $backorders;
     $this->moduleManager = $moduleManager;
     $this->coreRegistry = $coreRegistry;
     $this->stockRegistry = $stockRegistry;
     $this->stockConfiguration = $stockConfiguration;
     parent::__construct($context, $data);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:20,代码来源:Inventory.php


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