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


PHP Template::_construct方法代码示例

本文整理汇总了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

 /**
  * @return void
  */
 protected function _construct()
 {
     $this->_loadData();
     $this->setStores([]);
     $this->setLanguages([]);
     return parent::_construct();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Switcher.php

示例2: _construct

 /**
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     //TODO: add full name logic
     $orders = $this->_orderCollectionFactory->create()->addAttributeToSelect('*')->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')->addAttributeToFilter('customer_id', $this->_customerSession->getCustomerId())->addAttributeToFilter('status', array('in' => $this->_orderConfig->getVisibleOnFrontStatuses()))->addAttributeToSort('created_at', 'desc')->setPageSize('5')->load();
     $this->setOrders($orders);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Recent.php

示例3: _construct

 protected function _construct()
 {
     parent::_construct();
     // CSRF protection
     $this->_customerSession->setFacebookCsrf($csrf = md5(uniqid(rand(), true)));
     $this->_clientFacebook->setState($csrf);
 }
开发者ID:LavoWeb,项目名称:Magento2-Inchoo_SocialConnect,代码行数:7,代码来源:Button.php

示例4: _construct

 /**
  * load the articles
  */
 protected function _construct()
 {
     parent::_construct();
     /** @var \Gemtoo\Blog\Model\ResourceModel\Article\Collection $articles */
     $articles = $this->articleCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('is_active', 1)->addStoreFilter($this->_storeManager->getStore()->getId())->setOrder('name', 'ASC');
     $this->setArticles($articles);
 }
开发者ID:pleminh,项目名称:Gemtoo,代码行数:10,代码来源:ListArticle.php

示例5: _construct

 protected function _construct()
 {
     parent::_construct();
     /** @var \Sample\News\Model\Resource\Author\Collection $authors */
     $collection = $this->_testimonialFactory->create()->getCollection()->addFieldToFilter('status', 1);
     $this->setTestimonial($collection);
 }
开发者ID:ktplKunj,项目名称:TestMagento,代码行数:7,代码来源:Tlist.php

示例6: _construct

 public function _construct()
 {
     if (!$this->getConfig('general_settings/enable')) {
         return;
     }
     parent::_construct();
 }
开发者ID:vasuscoin,项目名称:brand,代码行数:7,代码来源:GroupList.php

示例7: _construct

 public function _construct()
 {
     if (!$this->hasData('template')) {
         $this->setData('template', self::DEFAULT_REVIEW_TEMPLATE);
     }
     return parent::_construct();
 }
开发者ID:swissup,项目名称:testimonials,代码行数:7,代码来源:SideReview.php

示例8: _construct

 /**
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $orders = $this->_orderCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('customer_id', $this->_customerSession->getCustomerId())->addFieldToFilter('status', array('in' => $this->_orderConfig->getVisibleOnFrontStatuses()))->setOrder('created_at', 'desc');
     $this->setOrders($orders);
     $this->pageConfig->setTitle(__('My Orders'));
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:History.php

示例9: _construct

 /**
  * load the authors
  */
 protected function _construct()
 {
     parent::_construct();
     /** @var \Sample\News\Model\ResourceModel\Author\Collection $authors */
     $authors = $this->authorCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('is_active', 1)->addStoreFilter($this->_storeManager->getStore()->getId())->setOrder('name', 'ASC');
     $this->setAuthors($authors);
 }
开发者ID:sz-bill,项目名称:Magento2.x,代码行数:10,代码来源:ListAuthor.php

示例10: _construct

 /**
  * Init orders
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
         $this->initOrders();
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:Sidebar.php

示例11: _construct

 protected function _construct()
 {
     parent::_construct();
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $postCollectionFactory = $objectManager->create('\\Test\\Testimonials\\Model\\ResourceModel\\Post\\CollectionFactory');
     $this->_postCollectionFactory = $postCollectionFactory;
     $this->setTemplate('widget/Testimonials.phtml');
 }
开发者ID:antonsbox,项目名称:testimonials,代码行数:8,代码来源:Testimonials.php

示例12: _construct

 /**
  * Add block data
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_urls = array('base' => $this->_storeManager->getStore()->getBaseUrl('web'), 'baseSecure' => $this->_storeManager->getStore()->getBaseUrl('web', true), 'current' => $this->_request->getRequestUri());
     $this->addBodyClass($this->_request->getFullActionName('-'));
     if ($this->_cacheState->isEnabled(self::CACHE_GROUP)) {
         $this->_sidResolver->setUseSessionVar(true);
     }
 }
开发者ID:aiesh,项目名称:magento2,代码行数:13,代码来源:Html.php

示例13: _construct

 public function _construct()
 {
     parent::_construct();
     $brand = $this->_brand;
     $group = $this->getCurrentGroup();
     $brandCollection = $brand->getCollection()->addFieldToFilter('group_id', $group->getId())->addFieldToFilter('status', 1)->setOrder('position', 'ASC');
     $this->setCollection($brandCollection);
     $template = 'group\\view.phtml';
     if (!$this->hasData('template')) {
         $this->setTemplate($template);
     }
 }
开发者ID:vasuscoin,项目名称:brand,代码行数:12,代码来源:View.php

示例14: _construct

 /**
  * Class constructor
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $purchased = $this->_linksFactory->create()->addFieldToFilter('customer_id', $this->currentCustomer->getCustomerId())->addOrder('created_at', 'desc');
     $this->setPurchased($purchased);
     $purchasedIds = [];
     foreach ($purchased as $_item) {
         $purchasedIds[] = $_item->getId();
     }
     if (empty($purchasedIds)) {
         $purchasedIds = [null];
     }
     $purchasedItems = $this->_itemsFactory->create()->addFieldToFilter('purchased_id', ['in' => $purchasedIds])->addFieldToFilter('status', ['nin' => [Item::LINK_STATUS_PENDING_PAYMENT, Item::LINK_STATUS_PAYMENT_REVIEW]])->setOrder('item_id', 'desc');
     $this->setItems($purchasedItems);
 }
开发者ID:nja78,项目名称:magento2,代码行数:20,代码来源:ListProducts.php

示例15: _construct

 public function _construct()
 {
     if (!$this->getConfig('general_settings/enable') || !$this->getConfig('brand_block/enable')) {
         return;
     }
     parent::_construct();
     $carousel_layout = $this->getConfig('brand_block/carousel_layout');
     $template = '';
     if ($carousel_layout == 'owl_carousel') {
         $template = 'block/brand_list_owl.phtml';
     } else {
         $template = 'block/brand_list_bootstrap.phtml';
     }
     if (!$this->getTemplate() && $template != '') {
         $this->setTemplate($template);
     }
 }
开发者ID:vasuscoin,项目名称:brand,代码行数:17,代码来源:BrandList.php


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