本文整理匯總了PHP中Magento\Framework\View\Element\Template::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Template::__construct方法的具體用法?PHP Template::__construct怎麽用?PHP Template::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\Element\Template
的用法示例。
在下文中一共展示了Template::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Checkout\Model\Session $checkoutSession
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\RecurringPayment\Model\Resource\Payment\CollectionFactory $recurringPaymentCollectionFactory
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\RecurringPayment\Model\Resource\Payment\CollectionFactory $recurringPaymentCollectionFactory, array $data = array())
{
$this->_checkoutSession = $checkoutSession;
$this->_customerSession = $customerSession;
$this->_recurringPaymentCollectionFactory = $recurringPaymentCollectionFactory;
parent::__construct($context, $data);
}
示例2: __construct
/**
* @param Template\Context $context
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param \Magento\Catalog\Model\Layer\FilterList $filterList
* @param \Magento\Catalog\Model\Layer\AvailabilityFlagInterface $visibilityFlag
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Catalog\Model\Layer\FilterList $filterList, \Magento\Catalog\Model\Layer\AvailabilityFlagInterface $visibilityFlag, array $data = [])
{
$this->_catalogLayer = $layerResolver->get();
$this->filterList = $filterList;
$this->visibilityFlag = $visibilityFlag;
parent::__construct($context, $data);
}
示例3: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\CatalogInventory\Api\StockStateInterface $stockState
* @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\CatalogInventory\Api\StockStateInterface $stockState, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, array $data = [])
{
$this->_coreRegistry = $registry;
$this->stockState = $stockState;
$this->stockRegistry = $stockRegistry;
parent::__construct($context, $data);
}
示例4: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Wishlist\Helper\Data $wishlistData
* @param \Magento\Wishlist\Model\Config $wishlistConfig
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Wishlist\Model\Config $wishlistConfig, array $data = [])
{
$this->_wishlistData = $wishlistData;
$this->_wishlistConfig = $wishlistConfig;
parent::__construct($context, $data);
$this->_isScopePrivate = true;
}
示例5: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Catalog\Helper\Category $categoryHelper
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Category $categoryHelper, \Magento\Catalog\Model\Indexer\Category\Flat\State $categoryFlatState, \Magento\Theme\Block\Html\Topmenu $topMenu)
{
$this->_categoryHelper = $categoryHelper;
$this->categoryFlatConfig = $categoryFlatState;
$this->topMenu = $topMenu;
parent::__construct($context);
}
示例6: __construct
public function __construct(\Dotdigitalgroup\Email\Helper\Data $helper, \Magento\Framework\ObjectManagerInterface $objectManagerInterface, \Magento\Backend\Block\Template\Context $context)
{
$data = [];
$this->_helper = $helper;
$this->_objectManager = $objectManagerInterface;
parent::__construct($context, $data);
}
示例7: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Sales\Model\Order\Config $orderConfig
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig, array $data = [])
{
$this->_orderCollectionFactory = $orderCollectionFactory;
$this->_customerSession = $customerSession;
$this->_orderConfig = $orderConfig;
parent::__construct($context, $data);
}
示例8: __construct
/**
* PHP Constructor
*
* @param \Magento\Framework\View\Element\Template\Context $context App context
* @param \Magento\Framework\Json\Helper\Data $jsonHelper The Magento's JSON Helper
* @param \Smile\ElasticsuiteTracker\Helper\Data $trackerHelper The Smile Tracker helper
* @param \Magento\Framework\Registry $registry The Magento registry
* @param array $data additional datas
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Json\Helper\Data $jsonHelper, \Smile\ElasticsuiteTracker\Helper\Data $trackerHelper, \Magento\Framework\Registry $registry, array $data = [])
{
parent::__construct($context, $data);
$this->jsonHelper = $jsonHelper;
$this->trackerHelper = $trackerHelper;
$this->registry = $registry;
}
示例9: __construct
/**
* @param \Inchoo\SocialConnect\Model\Facebook\Oauth2\Client $clientFacebook
* @param \Magento\Framework\Registry $registry
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Framework\View\Element\Template\Context $context
* @param array $data
*/
public function __construct(\Inchoo\SocialConnect\Model\Facebook\Oauth2\Client $clientFacebook, \Magento\Framework\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\View\Element\Template\Context $context, array $data = array())
{
$this->_clientFacebook = $clientFacebook;
$this->_registry = $registry;
$this->_customerSession = $customerSession;
parent::__construct($context, $data);
}
示例10: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Sales\Model\OrderFactory $orderFactory
* @param array $data
* @codeCoverageIgnore
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Catalog\Model\Session $catalogSession, \Magento\Checkout\Model\Session $checkoutSession, array $data = [])
{
$this->_orderFactory = $orderFactory;
$this->_catalogSession = $catalogSession;
$this->_checkoutSession = $checkoutSession;
parent::__construct($context, $data);
}
示例11: __construct
/**
* @param Template\Context $context
* @param SaleableInterface $saleableItem
* @param PriceInterface $price
* @param RendererPool $rendererPool
* @param array $data
*/
public function __construct(Template\Context $context, SaleableInterface $saleableItem, PriceInterface $price, RendererPool $rendererPool, array $data = [])
{
$this->saleableItem = $saleableItem;
$this->price = $price;
$this->rendererPool = $rendererPool;
parent::__construct($context, $data);
}
示例12: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Customer\Helper\Address $addressHelper
* @param CustomerMetadataInterface $customerMetadata
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Helper\Address $addressHelper, CustomerMetadataInterface $customerMetadata, array $data = [])
{
$this->_addressHelper = $addressHelper;
$this->customerMetadata = $customerMetadata;
parent::__construct($context, $data);
$this->_isScopePrivate = true;
}
示例13: __construct
/**
* @param \Ced\DevTool\Block\Context $context
* @param \Magento\Framework\UrlFactory $urlFactory
*/
public function __construct(\Ced\DevTool\Block\Context $context, UrlFactory $urlFactory)
{
$this->_devToolHelper = $context->getDevToolHelper();
$this->_config = $context->getConfig();
$this->_urlApp = $urlFactory->create();
parent::__construct($context);
}
示例14: __construct
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Rss\Model\RssFactory $rssFactory
* @param \Magento\Rss\Model\Resource\OrderFactory $orderFactory
* @param array $data
*/
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\Rss\Model\Resource\OrderFactory $orderFactory, array $data = array())
{
$this->_coreRegistry = $registry;
$this->_rssFactory = $rssFactory;
$this->_orderFactory = $orderFactory;
parent::__construct($context, $data);
}
示例15: __construct
/**
* {@inheritdoc}
* @param Context $context
* @param QueryHelper $queryHelper
* @param TextHelper $textHelper
* @param UrlFactory $urlFactory
*/
public function __construct(Context $context, QueryHelper $queryHelper, TextHelper $textHelper, UrlFactory $urlFactory)
{
$this->query = $queryHelper;
$this->urlFactory = $urlFactory;
$this->text = $textHelper;
parent::__construct($context);
}