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


PHP UrlInterface::getBaseUrl方法代码示例

本文整理汇总了PHP中Magento\Backend\Model\UrlInterface::getBaseUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlInterface::getBaseUrl方法的具体用法?PHP UrlInterface::getBaseUrl怎么用?PHP UrlInterface::getBaseUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Backend\Model\UrlInterface的用法示例。


在下文中一共展示了UrlInterface::getBaseUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: aroundDispatch

 /**
  * @param \Magento\Backend\App\AbstractAction $subject
  * @param callable $proceed
  * @param \Magento\Framework\App\RequestInterface $request
  *
  * @return mixed
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundDispatch(\Magento\Backend\App\AbstractAction $subject, \Closure $proceed, \Magento\Framework\App\RequestInterface $request)
 {
     $requestedActionName = $request->getActionName();
     if (in_array($requestedActionName, $this->_openActions)) {
         $request->setDispatched(true);
     } else {
         if ($this->_auth->getUser()) {
             $this->_auth->getUser()->reload();
         }
         if (!$this->_auth->isLoggedIn()) {
             $this->_processNotLoggedInUser($request);
         } else {
             $this->_auth->getAuthStorage()->prolong();
             $backendApp = null;
             if ($request->getParam('app')) {
                 $backendApp = $this->backendAppList->getCurrentApp();
             }
             if ($backendApp) {
                 $resultRedirect = $this->resultRedirectFactory->create();
                 $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($this->backendUrl->getBaseUrl());
                 $baseUrl = $baseUrl . $backendApp->getStartupPage();
                 return $resultRedirect->setUrl($baseUrl);
             }
         }
     }
     $this->_auth->getAuthStorage()->refreshAcl();
     return $proceed($request);
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:36,代码来源:Authentication.php

示例2: getConfig

 /**
  * Return Wysiwyg config as \Magento\Framework\DataObject
  *
  * Config options description:
  *
  * enabled:                 Enabled Visual Editor or not
  * hidden:                  Show Visual Editor on page load or not
  * use_container:           Wrap Editor contents into div or not
  * no_display:              Hide Editor container or not (related to use_container)
  * translator:              Helper to translate phrases in lib
  * files_browser_*:         Files Browser (media, images) settings
  * encode_directives:       Encode template directives with JS or not
  *
  * @param array|\Magento\Framework\DataObject $data Object constructor params to override default config values
  * @return \Magento\Framework\DataObject
  */
 public function getConfig($data = [])
 {
     $config = new \Magento\Framework\DataObject();
     $config->setData(['enabled' => $this->isEnabled(), 'hidden' => $this->isHidden(), 'use_container' => false, 'add_variables' => true, 'add_widgets' => true, 'no_display' => false, 'encode_directives' => true, 'baseStaticUrl' => $this->_assetRepo->getStaticViewFileContext()->getBaseUrl(), 'baseStaticDefaultUrl' => str_replace('index.php/', '', $this->_backendUrl->getBaseUrl()) . $this->filesystem->getUri(DirectoryList::STATIC_VIEW) . '/', 'directives_url' => $this->_backendUrl->getUrl('cms/wysiwyg/directive'), 'popup_css' => $this->_assetRepo->getUrl('mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css'), 'content_css' => $this->_assetRepo->getUrl('mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css'), 'width' => '100%', 'height' => '500px', 'plugins' => []]);
     $config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
     if ($this->_authorization->isAllowed('Magento_Cms::media_gallery')) {
         $config->addData(['add_images' => true, 'files_browser_window_url' => $this->_backendUrl->getUrl('cms/wysiwyg_images/index'), 'files_browser_window_width' => $this->_windowSize['width'], 'files_browser_window_height' => $this->_windowSize['height']]);
     }
     if (is_array($data)) {
         $config->addData($data);
     }
     if ($config->getData('add_variables')) {
         $settings = $this->_variableConfig->getWysiwygPluginSettings($config);
         $config->addData($settings);
     }
     if ($config->getData('add_widgets')) {
         $settings = $this->_widgetConfig->getPluginSettings($config);
         $config->addData($settings);
     }
     return $config;
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:37,代码来源:Config.php


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