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


PHP MauticFactory::getInstalledThemes方法代码示例

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


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

示例1: getPath

 /**
  * {@inheritdoc}
  */
 public function getPath()
 {
     $controller = str_replace('\\', '/', $this->get('controller'));
     if (!empty($this->themeOverride)) {
         try {
             $theme = $this->factory->getTheme($this->themeOverride);
             $themeDir = $theme->getThemePath();
         } catch (\Exception $e) {
         }
     } else {
         $theme = $this->factory->getTheme();
         $themeDir = $theme->getThemePath();
     }
     $fileName = $this->get('name') . '.' . $this->get('format') . '.' . $this->get('engine');
     $path = (empty($controller) ? '' : $controller . '/') . $fileName;
     if (!empty($this->parameters['bundle'])) {
         $bundleRoot = $this->factory->getSystemPath('bundles', true);
         $addonRoot = $this->factory->getSystemPath('addons', true);
         // Check for a system-wide override
         $themePath = $this->factory->getSystemPath('themes', true);
         $systemTemplate = $themePath . '/system/' . $this->parameters['bundle'] . '/' . $path;
         if (file_exists($systemTemplate)) {
             $template = $systemTemplate;
         } else {
             //check for an override and load it if there is
             if (!empty($themeDir) && file_exists($themeDir . '/html/' . $this->parameters['bundle'] . '/' . $path)) {
                 // Theme override
                 $template = $themeDir . '/html/' . $this->parameters['bundle'] . '/' . $path;
             } else {
                 preg_match('/Mautic(.*?)Bundle/', $this->parameters['bundle'], $match);
                 if (!empty($match[1]) && file_exists($bundleRoot . '/' . $match[1] . 'Bundle/Views/' . $path) || file_exists($addonRoot . '/' . $this->parameters['bundle'] . '/Views/' . $path)) {
                     // Mautic core template
                     $template = '@' . $this->get('bundle') . '/Views/' . $path;
                 }
             }
         }
     } else {
         $themes = $this->factory->getInstalledThemes();
         if (isset($themes[$controller])) {
             //this is a file in a specific Mautic theme folder
             $theme = $this->factory->getTheme($controller);
             $template = $theme->getThemePath() . '/html/' . $fileName;
         }
     }
     if (empty($template)) {
         //try the parent
         return parent::getPath();
     }
     return $template;
 }
开发者ID:woakes070048,项目名称:mautic,代码行数:53,代码来源:TemplateReference.php

示例2: __construct

 /**
  * @param MauticFactory $factory
  */
 public function __construct(MauticFactory $factory)
 {
     $this->translator = $factory->getTranslator();
     $this->themes = $factory->getInstalledThemes('asset');
     $this->assetModel = $factory->getModel('asset');
 }
开发者ID:woakes070048,项目名称:mautic,代码行数:9,代码来源:AssetType.php


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