php Magento-Framework-App-Action-Action类(方法)实例源码

下面列出了php Magento-Framework-App-Action-Action 类(方法)源码代码实例,从而了解它的用法。

作者:smile-s    项目:elasticsuit   
/**
  * Constructor.
  *
  * @param \Magento\Framework\App\Action\Context            $context           Controller action context.
  * @param \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory JSON result factory.
  * @param \Magento\Catalog\Model\Layer\Resolver            $layerResolver     Layer resolver.
  * @param \Magento\Catalog\Model\Layer\FilterList[]        $filterListPool    Filter list pool.
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory, \Magento\Catalog\Model\Layer\Resolver $layerResolver, $filterListPool = [])
 {
     parent::__construct($context);
     $this->jsonResultFactory = $jsonResultFactory;
     $this->layerResolver = $layerResolver;
     $this->filterListPool = $filterListPool;
 }

作者:Atli    项目:docker-magento   
/**
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Rss\Helper\WishlistRss $wishlistHelper
  * @param \Magento\Customer\Model\Session $customerSession
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Rss\Helper\WishlistRss $wishlistHelper, \Magento\Customer\Model\Session $customerSession)
 {
     $this->_scopeConfig = $scopeConfig;
     $this->_wishlistHelper = $wishlistHelper;
     $this->_customerSession = $customerSession;
     parent::__construct($context);
 }

作者:nblai    项目:magescotc   
/**
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Checkout\Model\Session $checkoutSession
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Sales\Api\OrderCustomerManagementInterface $orderCustomerService
  * @codeCoverageIgnore
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Api\OrderCustomerManagementInterface $orderCustomerService)
 {
     $this->checkoutSession = $checkoutSession;
     $this->customerSession = $customerSession;
     $this->orderCustomerService = $orderCustomerService;
     parent::__construct($context);
 }

作者:osmansorka    项目:magento2-blog-modul   
/**
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
  * @param \OsmanSorkar\Blog\Model\postFactory
  */
 function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \OsmanSorkar\Blog\Model\Post $post, \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory)
 {
     $this->resultPageFactory = $resultPageFactory;
     $this->post = $post;
     $this->resultForwardFactory = $resultForwardFactory;
     parent::__construct($context);
 }

作者:joelholtzman7    项目:bigfatbow   
public function __construct(\Magento\Framework\App\Action\Context $context, \MageClass\First\Model\Test $test, \Magento\Catalog\Model\ProductFactory $productFactory)
 {
     $this->_test = $test;
     # Reference this product factory object
     $this->_productFactory = $productFactory;
     parent::__construct($context);
 }

作者:shabbirvividad    项目:magento   
/**
  * @param Action\Context $context
  * @param OrderLoaderInterface $orderLoader
  * @param Registry $registry
  * @param RedirectFactory $resultRedirectFactory
  */
 public function __construct(Action\Context $context, OrderLoaderInterface $orderLoader, Registry $registry, RedirectFactory $resultRedirectFactory)
 {
     $this->orderLoader = $orderLoader;
     $this->_coreRegistry = $registry;
     $this->resultRedirectFactory = $resultRedirectFactory;
     parent::__construct($context);
 }

作者:pradeep-wagent    项目:magento   
/**
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Magento\Shipping\Model\InfoFactory $shippingInfoFactory
  * @param \Magento\Sales\Model\OrderFactory $orderFactory
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Shipping\Model\InfoFactory $shippingInfoFactory, \Magento\Sales\Model\OrderFactory $orderFactory)
 {
     $this->_coreRegistry = $coreRegistry;
     $this->_shippingInfoFactory = $shippingInfoFactory;
     $this->_orderFactory = $orderFactory;
     parent::__construct($context);
 }

作者:aies    项目:magento   
/**
  * Construct
  *
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Persistent\Model\Observer $persistentObserver
  * @param \Magento\Checkout\Model\Session $checkoutSession
  * @param \Magento\Customer\Model\Session $customerSession
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Persistent\Model\Observer $persistentObserver, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession)
 {
     $this->_persistentObserver = $persistentObserver;
     $this->_checkoutSession = $checkoutSession;
     $this->_customerSession = $customerSession;
     parent::__construct($context);
 }

作者:nawajs    项目:Ameex_CancelOrde   
public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Framework\App\Request\Http $request, \Magento\Sales\Api\OrderManagementInterface $orderManagement)
 {
     $this->request = $request;
     $this->orderManagement = $orderManagement;
     $this->resultPageFactory = $resultPageFactory;
     parent::__construct($context);
 }

作者:aies    项目:magento   
/**
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Magento\Framework\DB\TransactionFactory $transactionFactory
  * @param \Magento\Sales\Model\OrderFactory $salesOrderFactory
  * @param OrderSender $orderSender
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\DB\TransactionFactory $transactionFactory, \Magento\Sales\Model\OrderFactory $salesOrderFactory, OrderSender $orderSender)
 {
     parent::__construct($context);
     $this->_transactionFactory = $transactionFactory;
     $this->_salesOrderFactory = $salesOrderFactory;
     $this->orderSender = $orderSender;
 }

作者:opexs    项目:magento   
/**
  * @param Action\Context $context
  * @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator
  * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider
  * @param \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor
  */
 public function __construct(Action\Context $context, \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator, \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor)
 {
     $this->_formKeyValidator = $formKeyValidator;
     $this->wishlistProvider = $wishlistProvider;
     $this->quantityProcessor = $quantityProcessor;
     parent::__construct($context);
 }

作者:dotmaile    项目:dotmailer-magento2-extensio   
/**
  * Getbasket constructor.
  *
  * @param \Magento\Checkout\Model\SessionFactory $checkoutSessionFactory
  * @param \Magento\Quote\Model\QuoteFactory      $quoteFactory
  * @param \Magento\Customer\Model\SessionFactory $sessionFactory
  * @param \Magento\Framework\App\Action\Context  $context
  */
 public function __construct(\Magento\Checkout\Model\SessionFactory $checkoutSessionFactory, \Magento\Quote\Model\QuoteFactory $quoteFactory, \Magento\Customer\Model\SessionFactory $sessionFactory, \Magento\Framework\App\Action\Context $context)
 {
     $this->checkoutSession = $checkoutSessionFactory;
     $this->sessionFactory = $sessionFactory;
     $this->quoteFactory = $quoteFactory;
     parent::__construct($context);
 }

作者:payn    项目:magento2-plugi   
/**
  * Index constructor.
  * @param \Magento\Framework\App\Action\Context $context
  * @param \Paynl\Payment\Model\Config $config
  * @param Session $checkoutSession
  * @param \Psr\Log\LoggerInterface $logger
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Paynl\Payment\Model\Config $config, Session $checkoutSession, \Psr\Log\LoggerInterface $logger)
 {
     $this->_config = $config;
     $this->_checkoutSession = $checkoutSession;
     $this->_logger = $logger;
     parent::__construct($context);
 }

作者:ThomasNegel    项目:dotmailer-magento2-extensio   
/**
  * Pass arguments for dependency injection
  *
  * @param \Magento\Framework\App\Action\Context $context
  */
 public function __construct(Context $context, PageFactory $pageFactory, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate)
 {
     $this->_scopeConfig = $scopeConfigInterface;
     $this->_localeDate = $localeDate;
     $this->pageFactory = $pageFactory;
     return parent::__construct($context);
 }

作者:opexs    项目:magento   
/**
  * @param Action\Context $context
  * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
  */
 public function __construct(Action\Context $context, \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
 {
     $this->wishlistProvider = $wishlistProvider;
     $this->_coreRegistry = $coreRegistry;
     $this->resultPageFactory = $resultPageFactory;
     parent::__construct($context);
 }

作者:SummaSolution    项目:cart-magento   
/**
  * Coupon constructor.
  *
  * @param \Magento\Framework\App\Action\Context      $context
  * @param \Magento\Checkout\Model\Session            $checkoutSession
  * @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
  * @param \Magento\Framework\Registry                $registry
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Quote\Api\CartRepositoryInterface $quoteRepository, \Magento\Framework\Registry $registry)
 {
     parent::__construct($context);
     $this->_checkoutSession = $checkoutSession;
     $this->quoteRepository = $quoteRepository;
     $this->_registry = $registry;
 }

作者:shabbirvividad    项目:magento   
/**
  * @param Context $context
  * @param Sidebar $sidebar
  * @param LoggerInterface $logger
  * @param Data $jsonHelper
  */
 public function __construct(Context $context, Sidebar $sidebar, LoggerInterface $logger, Data $jsonHelper)
 {
     $this->sidebar = $sidebar;
     $this->logger = $logger;
     $this->jsonHelper = $jsonHelper;
     parent::__construct($context);
 }

作者:pradeep-wagent    项目:magento   
/**
  * Check customer authentication for some actions
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->customerSession->authenticate()) {
         $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
     }
     return parent::dispatch($request);
 }

作者:BlackIkeEagl    项目:magento2-continuousph   
/**
  * @param Context $context
  * @param LoggerInterface $logger
  * @param SessionManagerInterface $session
  * @param GetPaymentNonceCommand $command
  */
 public function __construct(Context $context, LoggerInterface $logger, SessionManagerInterface $session, GetPaymentNonceCommand $command)
 {
     parent::__construct($context);
     $this->logger = $logger;
     $this->session = $session;
     $this->command = $command;
 }

作者:kidaa3    项目:magento2-platforms   
/**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  * @throws \Magento\Framework\Exception\NotFoundException
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->scopeConfig->isSetFlag(self::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE)) {
         throw new NotFoundException(__('Page not found.'));
     }
     return parent::dispatch($request);
 }


问题


面经


文章

微信
公众号

扫码关注公众号