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


PHP ModuleModel::findOneBy方法代码示例

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


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

示例1: compile

 /**
  * Das Modul generieren.
  *
  * Werte für das Template bereitstellen.
  *
  * @return void
  */
 protected function compile()
 {
     // Suche in Datenbank nach einem Modul des Typs 'nlsh_easy_Piwik_Module',
     $objPiwikModule = \ModuleModel::findOneBy('type', 'nlsh_easy_Piwik_Counter');
     // Wenn Modul vorhanden
     if ($objPiwikModule !== NULL) {
         // Impressumstext hinzufügen
         $arrEasyPiwikImpressum['impressumtext'] = $objPiwikModule->nlsh_piwik_impressum;
         // Abschalten einbinden, falls erwünscht und URL vorhanden
         if ($objPiwikModule->nlsh_piwik_noscan == TRUE && $objPiwikModule->nlsh_piwik_domain == TRUE) {
             // Pfad zur Website mit scheme "http://" vorbelegen,
             // falls scheme nicht vorhanden
             $parseUrl = parse_url($objPiwikModule->nlsh_piwik_domain);
             if (!$parseUrl['scheme']) {
                 $objPiwikModule->nlsh_piwik_domain = 'http://' . $objPiwikModule->nlsh_piwik_domain;
             }
             // Pfad zur CSS- Datei hinzufügen
             $urlCssOptOut = $this->Environment->url . $GLOBALS['TL_CONFIG']['websitePath'] . '/files/nlsh_piwik_counter_' . $objPiwikModule->id . '.css';
             // HTML- String für das iframe erzeugen und hinzufügen
             $arrEasyPiwikImpressum['piwiknoscan'] = sprintf("<iframe class =\"piwikiframe\" frameborder=\"0\" src=\"%s/index.php?module=CoreAdminHome&amp;action=optOut&amp;language=%s&amp;css=%s\"></iframe>", $objPiwikModule->nlsh_piwik_domain, $GLOBALS['TL_LANGUAGE'], $urlCssOptOut);
         }
     } else {
         // Fehlermeldung, wenn kein PIWIK- Modul vorhanden
         $arrEasyPiwikImpressum['nopiwikmodul'] = $GLOBALS['TL_LANG']['MSC']['nlsh_easy_Piwik_ContentImpressum']['nopiwikmodul'];
     }
     // und ab in das Template
     $this->Template->piwikimpressum = (object) $arrEasyPiwikImpressum;
 }
开发者ID:nlsh,项目名称:nlsh_easy_piwik_counter,代码行数:35,代码来源:ContentNlshEasyPiwikImpressum.php

示例2: loadModalContent

 /**
  * load modal content
  */
 public function loadModalContent()
 {
     global $objPage;
     $id = \Input::get('modal');
     if ($id == '') {
         return;
     }
     $page = \Input::get('page');
     // load layout because we need to initiate bootstrap
     /** @var \PageModel $objPage */
     $objPage = \PageModel::findByPk($page);
     $objPage->loadDetails();
     if ($objPage === null) {
         $this->log(sprintf('Page ID %s not found', $page), 'Netzmacht\\Bootstrap\\Ajax::loadModalContent', TL_ERROR);
         exit;
     }
     $objLayout = $this->getPageLayout($objPage);
     // Set the layout template and template group
     $objPage->template = $objLayout->template ?: 'fe_page';
     $objPage->templateGroup = $objLayout->getRelated('pid')->templates;
     // trigger getPageLayout hook so
     if (isset($GLOBALS['TL_HOOKS']['getPageLayout']) && is_array($GLOBALS['TL_HOOKS']['getPageLayout'])) {
         foreach ($GLOBALS['TL_HOOKS']['getPageLayout'] as $hook) {
             $this->import($hook[0]);
             $this->{$hook[0]}->{$hook[1]}($objPage, $objLayout, $this);
         }
     }
     $model = \ModuleModel::findOneBy('type="bootstrap_modal" AND tl_module.id', $id);
     if ($model === null) {
         exit;
     }
     $model->isAjax = true;
     $this->output($this->getFrontendModule($model));
 }
开发者ID:netzmacht,项目名称:contao-bootstrap,代码行数:37,代码来源:Ajax.php

示例3: generateOrderDetails

 /**
  * Generate the order details view when editing an order
  *
  * @param object $dc
  *
  * @return string
  */
 public function generateOrderDetails($dc)
 {
     $objOrder = Order::findByPk($dc->id);
     if ($objOrder === null) {
         return '';
     }
     $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/print.min.css|print');
     // Try to find a order details module or create a dummy FE module model
     if (($objModuleModel = \ModuleModel::findOneBy('type', 'iso_orderdetails')) === null) {
         $objModuleModel = new \ModuleModel();
         $objModuleModel->type = 'iso_orderdetails';
         $objModuleModel->iso_collectionTpl = 'iso_collection_default';
     }
     // Generate a regular order details module
     \Input::setGet('uid', $objOrder->uniqid);
     $objModule = new OrderDetails($objModuleModel);
     return Haste::getInstance()->call('replaceInsertTags', $objModule->generate(true));
 }
开发者ID:rpquadrat,项目名称:core,代码行数:25,代码来源:Callback.php


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