本文整理汇总了PHP中Magento\Backend\Block\Template类的典型用法代码示例。如果您正苦于以下问题:PHP Template类的具体用法?PHP Template怎么用?PHP Template使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Template类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\App\ProductMetadataInterface $productMetaData
* @param \Magento\Framework\Module\ModuleList\Loader $loader
* @param \Ebizmarts\Mandrill\Helper\Data $mandrillHelper
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\App\ProductMetadataInterface $productMetaData, \Magento\Framework\Module\ModuleList\Loader $loader, \Ebizmarts\Mandrill\Helper\Data $mandrillHelper, array $data = [])
{
parent::__construct($context, $data);
$this->_metaData = $productMetaData;
$this->_loader = $loader;
$this->_mandrillHelper = $mandrillHelper;
}
开发者ID:ebizmarts,项目名称:magento2-autoresponder,代码行数:14,代码来源:Hint.php
示例2: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $defaultColumnRenderer
* @param TaxHelper $taxHelper
* @param ItemPriceRenderer $itemPriceRenderer
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $defaultColumnRenderer, TaxHelper $taxHelper, ItemPriceRenderer $itemPriceRenderer, array $data = array())
{
$this->defaultColumnRenderer = $defaultColumnRenderer;
$this->itemPriceRenderer = $itemPriceRenderer;
$this->itemPriceRenderer->setZone('sales');
parent::__construct($context, $data);
}
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:Renderer.php
示例3: __construct
/**
* Block constructor.
*
* @param \Magento\Backend\Block\Template\Context $context Templating context.
* @param \Magento\Framework\Data\Form\Element\Factory $elementFactory Form element factory.
* @param \Magento\Rule\Block\Conditions $conditions Rule conditions block.
* @param \Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory Search rule factory.
* @param array $data Additional data.
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Data\Form\Element\Factory $elementFactory, \Magento\Rule\Block\Conditions $conditions, \Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory, array $data = [])
{
$this->elementFactory = $elementFactory;
$this->conditions = $conditions;
$this->rule = $ruleFactory->create();
parent::__construct($context, $data);
}
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:16,代码来源:Conditions.php
示例4: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param ConfigInterface $securityConfig
* @param \Magento\Security\Model\AdminSessionsManager $sessionsManager
* @param RemoteAddress $remoteAddress
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, ConfigInterface $securityConfig, \Magento\Security\Model\AdminSessionsManager $sessionsManager, RemoteAddress $remoteAddress)
{
parent::__construct($context);
$this->securityConfig = $securityConfig;
$this->sessionsManager = $sessionsManager;
$this->remoteAddress = $remoteAddress;
}
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:Activity.php
示例5: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\Stdlib\DateTime $dateTime
* @param \Magento\Framework\Registry $registry
* @param DataObjectHelper $dataObjectHelper
* @param \Magento\Framework\ObjectManagerInterface $objectManager
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Registry $registry, DataObjectHelper $dataObjectHelper, \Magento\Framework\ObjectManagerInterface $objectManager, array $data = [])
{
parent::__construct($context, $data);
$this->coreRegistry = $registry;
$this->dateTime = $dateTime;
$this->objectManager = $objectManager;
}
开发者ID:shockwavemk,项目名称:magento2-module-cron-schedule,代码行数:16,代码来源:Left.php
示例6: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Store\Model\Resource\Website\Collection $websiteCollection
* @param \Magento\Theme\Model\Config\Customization $customizationConfig
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Store\Model\Resource\Website\Collection $websiteCollection, \Magento\Theme\Model\Config\Customization $customizationConfig, \Magento\Framework\Json\Helper\Data $jsonHelper, array $data = [])
{
$this->jsonHelper = $jsonHelper;
$this->_websiteCollection = $websiteCollection;
$this->_customizationConfig = $customizationConfig;
parent::__construct($context, $data);
}
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:StoreView.php
示例7: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Review\Model\ResourceModel\Rating\Option\Vote\CollectionFactory $votesFactory
* @param \Magento\Review\Model\RatingFactory $ratingFactory
* @param \Magento\Framework\Registry $registry
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Review\Model\ResourceModel\Rating\Option\Vote\CollectionFactory $votesFactory, \Magento\Review\Model\RatingFactory $ratingFactory, \Magento\Framework\Registry $registry, array $data = [])
{
$this->_votesFactory = $votesFactory;
$this->_ratingFactory = $ratingFactory;
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Summary.php
示例8: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
* @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
* @param \Magento\Framework\Registry $registry
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, \Magento\Framework\Registry $registry, array $data = [])
{
$this->stockRegistry = $stockRegistry;
$this->stockConfiguration = $stockConfiguration;
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:AbstractItems.php
示例9: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory, \Magento\Framework\Validator\UniversalFactory $universalFactory, array $data = [])
{
parent::__construct($context, $data);
$this->_registry = $registry;
$this->_attrOptionCollectionFactory = $attrOptionCollectionFactory;
$this->_universalFactory = $universalFactory;
}
开发者ID:nja78,项目名称:magento2,代码行数:14,代码来源:Options.php
示例10: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\Locale\ListsInterface $localeLists
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
* @param \Magento\Core\Helper\Url $urlHelper
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Locale\ListsInterface $localeLists, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Core\Helper\Url $urlHelper, array $data = array())
{
$this->_localeLists = $localeLists;
$this->_localeResolver = $localeResolver;
$this->_urlHelper = $urlHelper;
parent::__construct($context, $data);
}
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:Locale.php
示例11: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Wyomind\SimpleGoogleShopping\Model\Feeds $sgsModel
* @param \Wyomind\SimpleGoogleShopping\Helper\Data $sgsHelper
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Wyomind\SimpleGoogleShopping\Model\Feeds $sgsModel, \Wyomind\SimpleGoogleShopping\Helper\Data $sgsHelper, \Wyomind\Core\Helper\Data $coreHelper, array $data = [])
{
$this->_sgsModel = $sgsModel;
$this->_sgsHelper = $sgsHelper;
$this->_coreHelper = $coreHelper;
parent::__construct($context, $data);
}
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:Report.php
示例12: _prepareLayout
/**
* {@inheritdoc}
*/
protected function _prepareLayout()
{
$this->setTemplate('Magento_Backend::system/design/index.phtml');
$this->getToolbar()->addChild('add_new_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Add Design Change'), 'onclick' => "setLocation('" . $this->getUrl('adminhtml/*/new') . "')", 'class' => 'add primary add-design-change'));
$this->getLayout()->getBlock('page-title')->setPageTitle('Store Design Schedule');
return parent::_prepareLayout();
}
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Design.php
示例13: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
* @param \Magento\Shipping\Model\Carrier\Source\GenericInterface $sourceSizeModel
* @param \Magento\Framework\Registry $coreRegistry
* @param \Magento\Shipping\Model\CarrierFactory $carrierFactory
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, \Magento\Shipping\Model\Carrier\Source\GenericInterface $sourceSizeModel, \Magento\Framework\Registry $coreRegistry, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = [])
{
$this->_jsonEncoder = $jsonEncoder;
$this->_coreRegistry = $coreRegistry;
$this->_sourceSizeModel = $sourceSizeModel;
$this->_carrierFactory = $carrierFactory;
parent::__construct($context, $data);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:Packaging.php
示例14: __construct
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $datetime, \Wyomind\Watchlog\Model\ResourceModel\Attempts\CollectionFactory $attemptsCollectionFactory, \Wyomind\Watchlog\Helper\Data $watchlogHelper, array $data = [])
{
$this->_datetime = $datetime;
$this->_attemptsCollectionFactory = $attemptsCollectionFactory;
$this->watchlogHelper = $watchlogHelper;
parent::__construct($context, $data);
$this->setTemplate('chart.phtml');
}
开发者ID:Doability,项目名称:magento2dev,代码行数:8,代码来源:Chart.php
示例15: __construct
/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree
* @param \Magento\Framework\Registry $registry
* @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = array())
{
$this->_categoryTree = $categoryTree;
$this->_coreRegistry = $registry;
$this->_categoryFactory = $categoryFactory;
$this->_withProductCount = true;
parent::__construct($context, $data);
}
开发者ID:aiesh,项目名称:magento2,代码行数:15,代码来源:AbstractCategory.php
示例16: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $elementFactory
* @param \Magento\Rule\Block\Conditions $conditions
* @param \Magento\CatalogWidget\Model\Rule $rule
* @param \Magento\Framework\Registry $registry
* @param \Magento\Backend\Block\Template\Context $context
* @param array $data
*/
public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Data\Form\Element\Factory $elementFactory, \Magento\Rule\Block\Conditions $conditions, \Magento\CatalogWidget\Model\Rule $rule, \Magento\Framework\Registry $registry, array $data = [])
{
$this->elementFactory = $elementFactory;
$this->conditions = $conditions;
$this->rule = $rule;
$this->registry = $registry;
parent::__construct($context, $data);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:Conditions.php
示例17: _prepareLayout
/**
* @return AbstractBlock|void
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->getToolbar()->addChild('createSnapshotButton', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('System Backup'), 'onclick' => "return backup.backup('" . \Magento\Framework\Backup\Factory::TYPE_SYSTEM_SNAPSHOT . "')", 'class' => 'primary system-backup']);
$this->getToolbar()->addChild('createMediaBackupButton', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Database and Media Backup'), 'onclick' => "return backup.backup('" . \Magento\Framework\Backup\Factory::TYPE_MEDIA . "')", 'class' => 'primary database-media-backup']);
$this->getToolbar()->addChild('createButton', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Database Backup'), 'onclick' => "return backup.backup('" . \Magento\Framework\Backup\Factory::TYPE_DB . "')", 'class' => 'task primary database-backup']);
$this->addChild('dialogs', 'Magento\\Backup\\Block\\Adminhtml\\Dialogs');
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:Backup.php
示例18: _prepareLayout
/**
* @return AbstractBlock
*/
protected function _prepareLayout()
{
if ($this->getToolbar()) {
$this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Save Attribute Set'), 'class' => 'save primary save-attribute-set', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#set-prop-form')))));
$this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/') . '\')', 'class' => 'back'));
}
$this->addChild('setForm', 'Magento\\Catalog\\Block\\Adminhtml\\Product\\Attribute\\Set\\Main\\Formset');
return parent::_prepareLayout();
}
开发者ID:aiesh,项目名称:magento2,代码行数:12,代码来源:Add.php
示例19: testGetItemPrice
public function testGetItemPrice()
{
$html = '$34.28';
$this->layoutMock->expects($this->once())->method('getBlock')->with('item_price')->will($this->returnValue($this->priceRenderBlock));
$this->priceRenderBlock->expects($this->once())->method('setItem')->with($this->itemMock);
$this->priceRenderBlock->expects($this->once())->method('toHtml')->will($this->returnValue($html));
$this->assertEquals($html, $this->block->getItemPrice($this->itemMock));
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:8,代码来源:DefaultItemsTest.php
示例20: _beforeToHtml
/**
* {@inheritdoc}
*/
protected function _beforeToHtml()
{
$this->assign('form', $this->_form);
$this->assign('element', $this->_element);
$this->assign('formBlock', $this->_formBlock);
return parent::_beforeToHtml();
}
开发者ID:shabbirvividads,项目名称:magento2,代码行数:10,代码来源:Element.php
注:本文中的Magento\Backend\Block\Template类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论