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


PHP AbstractBlock::__construct方法代碼示例

本文整理匯總了PHP中Magento\Framework\View\Element\AbstractBlock::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractBlock::__construct方法的具體用法?PHP AbstractBlock::__construct怎麽用?PHP AbstractBlock::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\View\Element\AbstractBlock的用法示例。


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

示例1: __construct

 /**
  * Construct
  *
  * @param \Magento\Framework\View\Element\Context $context
  * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Cms\Model\BlockFactory $blockFactory
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Cms\Model\Template\FilterProvider $filterProvider, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Cms\Model\BlockFactory $blockFactory, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_filterProvider = $filterProvider;
     $this->_storeManager = $storeManager;
     $this->_blockFactory = $blockFactory;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:16,代碼來源:Block.php

示例2: __construct

 /**
  * @param \Magento\Framework\View\Element\Context $context
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param Registry $registry
  * @param \Magento\Framework\Data\Form $form
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, Registry $registry, \Magento\Framework\Data\Form $form, $data = [])
 {
     $this->storeManager = $storeManager;
     $this->registry = $registry;
     $this->form = $form;
     parent::__construct($context, $data);
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:14,代碼來源:Gallery.php

示例3: __construct

 /**
  * @param \Magento\Framework\View\Element\Context $context
  * @param RequireJsConfig $config
  * @param \Magento\Framework\View\Page\Config $pageConfig
  * @param \Magento\Translation\Model\FileManager $fileManager
  * @param Inline $inline
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Framework\View\Page\Config $pageConfig, \Magento\Translation\Model\FileManager $fileManager, Inline $inline, array $data = [])
 {
     parent::__construct($context, $data);
     $this->pageConfig = $pageConfig;
     $this->fileManager = $fileManager;
     $this->inline = $inline;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:15,代碼來源:Config.php

示例4: __construct

 public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Framework\HTTP\ZendClientFactory $clientFactory, \Psr\Log\LoggerInterface $logger, array $data = [])
 {
     $this->_isScopePrivate = true;
     $this->_clientFactory = $clientFactory;
     $this->_logger = $logger;
     parent::__construct($context, $data);
 }
開發者ID:hientruongbluecom,項目名稱:cemagento2,代碼行數:7,代碼來源:ExchangeRate.php

示例5: __construct

 /**
  * @param \Magento\Framework\View\Element\Context $context
  * @param RequireJsConfig $config
  * @param \Magento\RequireJs\Model\FileManager $fileManager
  * @param \Magento\Framework\View\Page\Config $pageConfig
  * @param \Magento\Framework\View\Asset\ConfigInterface $bundleConfig
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, RequireJsConfig $config, \Magento\RequireJs\Model\FileManager $fileManager, \Magento\Framework\View\Page\Config $pageConfig, \Magento\Framework\View\Asset\ConfigInterface $bundleConfig, array $data = [])
 {
     parent::__construct($context, $data);
     $this->config = $config;
     $this->fileManager = $fileManager;
     $this->pageConfig = $pageConfig;
     $this->bundleConfig = $bundleConfig;
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:16,代碼來源:Config.php

示例6: __construct

 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Framework\App\Http\Context $httpContext
  * @param \Magento\SalesRule\Model\Rss\Discounts $rssModel
  * @param \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Http\Context $httpContext, \Magento\SalesRule\Model\Rss\Discounts $rssModel, \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder, array $data = [])
 {
     $this->storeManager = $context->getStoreManager();
     $this->rssModel = $rssModel;
     $this->httpContext = $httpContext;
     $this->rssUrlBuilder = $rssUrlBuilder;
     parent::__construct($context, $data);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:15,代碼來源:Discounts.php

示例7: __construct

 /**
  * @param \Magento\Framework\View\Element\Context $context
  * @param \Magento\Framework\Data\FormFactory $formFactory
  * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory
  * @param \Magento\Paypal\Model\StandardFactory $paypalStandardFactory
  * @param \Magento\Framework\Math\Random $mathRandom
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Framework\Data\FormFactory $formFactory, \Magento\Framework\Data\Form\Element\Factory $elementFactory, \Magento\Paypal\Model\StandardFactory $paypalStandardFactory, \Magento\Framework\Math\Random $mathRandom, array $data = array())
 {
     $this->_formFactory = $formFactory;
     $this->_elementFactory = $elementFactory;
     $this->_paypalStandardFactory = $paypalStandardFactory;
     $this->mathRandom = $mathRandom;
     parent::__construct($context, $data);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:16,代碼來源:Redirect.php

示例8: __construct

 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Catalog\Helper\Image $imageHelper
  * @param \Magento\Catalog\Model\Rss\Product\NewProducts $rssModel
  * @param \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Image $imageHelper, \Magento\Catalog\Model\Rss\Product\NewProducts $rssModel, \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder, array $data = [])
 {
     $this->imageHelper = $imageHelper;
     $this->rssModel = $rssModel;
     $this->rssUrlBuilder = $rssUrlBuilder;
     $this->storeManager = $context->getStoreManager();
     parent::__construct($context, $data);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:15,代碼來源:NewProducts.php

示例9: __construct

 /**
  * @param RssModel $rssModel
  * @param Url $urlModel
  * @param CollectionFactory $articleCollectionFactory
  * @param StoreManagerInterface $storeManager
  * @param Context $context
  * @param array $data
  */
 public function __construct(RssModel $rssModel, Url $urlModel, CollectionFactory $articleCollectionFactory, StoreManagerInterface $storeManager, Context $context, array $data = [])
 {
     $this->rssModel = $rssModel;
     $this->urlModel = $urlModel;
     $this->articleCollectionFactory = $articleCollectionFactory;
     $this->storeManager = $storeManager;
     parent::__construct($context, $data);
 }
開發者ID:pleminh,項目名稱:Gemtoo,代碼行數:16,代碼來源:Rss.php

示例10: __construct

 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Catalog\Helper\Image $imageHelper
  * @param \Magento\Catalog\Model\Rss\Product\NewProducts $rssModel
  * @param \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Mageplaza\Blog\Model\CategoryFactory $rssModel, \Mageplaza\Blog\Helper\Data $helper, \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder, array $data = [])
 {
     $this->helper = $helper;
     $this->rssModel = $rssModel;
     $this->rssUrlBuilder = $rssUrlBuilder;
     $this->storeManager = $context->getStoreManager();
     parent::__construct($context, $data);
 }
開發者ID:mageplaza,項目名稱:magento-2-blog-extension,代碼行數:15,代碼來源:Category.php

示例11: __construct

 /**
  * Constructor
  *
  * @param \Magento\Framework\View\Element\Context $context
  * @param ElementFactory $elementFactory
  * @param \Magento\Directory\Model\CountryFactory $countryFactory ,
  * @param \Magento\Customer\Model\Address\Converter $addressConverter
  * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $metadataService
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, ElementFactory $elementFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Customer\Model\Address\Converter $addressConverter, \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $metadataService, array $data = array())
 {
     $this->_elementFactory = $elementFactory;
     $this->_addressConverter = $addressConverter;
     $this->_countryFactory = $countryFactory;
     $this->_metadataService = $metadataService;
     parent::__construct($context, $data);
     $this->_isScopePrivate = true;
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:19,代碼來源:DefaultRenderer.php

示例12: __construct

 /**
  * Constructor
  *
  * @param \Magento\Framework\View\Element\Context $context
  * @param ElementFactory $elementFactory
  * @param \Magento\Directory\Model\CountryFactory $countryFactory
  * @param \Magento\Customer\Api\AddressMetadataInterface $metadataService
  * @param Mapper $addressMapper
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, ElementFactory $elementFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Customer\Api\AddressMetadataInterface $metadataService, Mapper $addressMapper, array $data = [])
 {
     $this->_elementFactory = $elementFactory;
     $this->_countryFactory = $countryFactory;
     $this->_addressMetadataService = $metadataService;
     $this->addressMapper = $addressMapper;
     parent::__construct($context, $data);
     $this->_isScopePrivate = true;
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:19,代碼來源:DefaultRenderer.php

示例13: __construct

 /**
  * Construct
  *
  * @param \Magento\Framework\View\Element\Context $context
  * @param \Magento\Cms\Model\Page $page
  * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Cms\Model\PageFactory $pageFactory
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Cms\Model\Page $page, \Magento\Cms\Model\Template\FilterProvider $filterProvider, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Cms\Model\PageFactory $pageFactory, array $data = array())
 {
     parent::__construct($context, $data);
     // used singleton (instead factory) because there exist dependencies on \Magento\Cms\Helper\Page
     $this->_page = $page;
     $this->_filterProvider = $filterProvider;
     $this->_storeManager = $storeManager;
     $this->_pageFactory = $pageFactory;
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:19,代碼來源:Page.php

示例14: __construct

 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
  * @param \Magento\Catalog\Model\Rss\Category $rssModel
  * @param \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder
  * @param \Magento\Catalog\Helper\Image $imageHelper
  * @param \Magento\Customer\Model\Session $customerSession
  * @param CategoryRepositoryInterface $categoryRepository
  * @param array $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Rss\Category $rssModel, \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder, \Magento\Catalog\Helper\Image $imageHelper, \Magento\Customer\Model\Session $customerSession, CategoryRepositoryInterface $categoryRepository, array $data = [])
 {
     $this->imageHelper = $imageHelper;
     $this->categoryFactory = $categoryFactory;
     $this->customerSession = $customerSession;
     $this->rssModel = $rssModel;
     $this->rssUrlBuilder = $rssUrlBuilder;
     $this->storeManager = $context->getStoreManager();
     $this->categoryRepository = $categoryRepository;
     parent::__construct($context, $data);
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:22,代碼來源:Category.php

示例15: __construct

 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Framework\App\Http\Context $httpContext
  * @param \Magento\Catalog\Helper\Image $imageHelper
  * @param \Magento\Catalog\Helper\Output $outputHelper
  * @param \Magento\Msrp\Helper\Data $msrpHelper
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param \Magento\Catalog\Model\Rss\Product\Special $rssModel
  * @param \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder
  * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
  * @param array $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Image $imageHelper, \Magento\Catalog\Helper\Output $outputHelper, \Magento\Msrp\Helper\Data $msrpHelper, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Catalog\Model\Rss\Product\Special $rssModel, \Magento\Framework\App\Rss\UrlBuilderInterface $rssUrlBuilder, \Magento\Framework\Locale\ResolverInterface $localeResolver, array $data = [])
 {
     $this->outputHelper = $outputHelper;
     $this->imageHelper = $imageHelper;
     $this->rssModel = $rssModel;
     $this->rssUrlBuilder = $rssUrlBuilder;
     $this->priceCurrency = $priceCurrency;
     $this->msrpHelper = $msrpHelper;
     $this->httpContext = $httpContext;
     $this->storeManager = $context->getStoreManager();
     parent::__construct($context, $data);
     $this->localeResolver = $localeResolver;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:26,代碼來源:Special.php


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