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


PHP TemplateLoader::getInstance方法代码示例

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


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

示例1: getAcknowledgementNotificationParameters

 /**
  * @param form_persistentdocument_baseform $form
  * @param form_persistentdocument_response $response
  * @param block_BlockRequest $request
  * @param array $result
  * @param String $acknowledgmentReceiver
  * @param String $replyTo
  * @return array
  */
 protected function getAcknowledgementNotificationParameters($form, $response, $request, $result, $acknowledgmentReceiver, $replyTo)
 {
     $contentTemplate = TemplateLoader::getInstance()->setPackageName('modules_form')->setMimeContentType(K::HTML)->load('Form-MailContent');
     $contentTemplate->setAttribute('items', $response->getAllData());
     $contentTemplate->setAttribute('response', $response->getResponseInfos());
     $parameters = $response->getData();
     $parameters[self::CONTENT_REPLACEMENT_NAME] = $contentTemplate->execute();
     $parameters[self::FORM_LABEL_REPLACEMENT_NAME] = $form->getLabel();
     return $parameters;
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:19,代码来源:BaseformService.class.php

示例2: getContentsFromRequest

 /**
  * @param array<TreeNode> $nodes
  * @param block_BlockRequest $request
  * @param form_persistentdocument_baseform $form
  * @return array
  */
 protected function getContentsFromRequest($nodes, $request, $form)
 {
     $contents = array();
     $markup = $form->getMarkup();
     foreach ($nodes as $node) {
         $document = $node->getPersistentDocument();
         if ($document instanceof form_persistentdocument_group) {
             $templateObject = TemplateLoader::getInstance()->setPackageName('modules_form')->setDirectory('templates/markup/' . $markup)->load('Form-Group');
             $elements = $this->getContentsFromRequest($node->getChildren(), $contents, $request, $markup);
             $attributes = array('id' => $document->getId(), 'label' => $document->getLabel(), 'description' => $document->getDescription(), 'elements' => $elements);
         } else {
             if ($document instanceof form_persistentdocument_field) {
                 $templateObject = TemplateLoader::getInstance()->setPackageName('modules_form')->setDirectory('templates/markup/' . $markup)->load($document->getSurroundingTemplate());
                 $html = FormHelper::fromFieldDocument($document, $request->hasParameter($document->getFieldName()) ? $request->getParameter($document->getFieldName()) : $document->getDefaultValue());
                 $attributes = array('id' => $document->getId(), 'label' => $document->getLabel(), 'description' => $document->getHelpText(), 'required' => $document->getRequired(), 'display' => f_util_ClassUtils::methodExists($document, 'getDisplay') ? $document->getDisplay() : '', 'html' => $html);
             } else {
                 if ($document instanceof form_persistentdocument_freecontent) {
                     $templateObject = TemplateLoader::getInstance()->setPackageName('modules_form')->setDirectory('templates/markup/' . $markup)->load('Form-FreeContent');
                     $attributes = array('id' => $document->getId(), 'label' => $document->getLabel(), 'description' => $document->getText(), 'required' => false, 'html' => '');
                 }
             }
             $templateObject->setAttribute('field', $attributes);
         }
         $contents[$document->getId()] = $templateObject->execute();
     }
     return $contents;
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:33,代码来源:BlockFormBaseAction.class.php

示例3: renderForm

 /**
  * @param form_persistentdocument_baseform $form
  * @param block_BlockRequest $formRequest
  * @param validation_Errors $errors
  * @param array<String> $scriptArray
  * @return String
  * @deprecated
  */
 public function renderForm($form, $formRequest, $errors, &$scriptArray)
 {
     $scriptArray[] = 'modules.form.lib.js.date-picker.date';
     $scriptArray[] = 'modules.form.lib.js.date-picker.date_' . RequestContext::getInstance()->getLang();
     $scriptArray[] = 'modules.form.lib.js.date-picker.jquery-bgiframe';
     $scriptArray[] = 'modules.form.lib.js.date-picker.jquery-dimensions';
     $scriptArray[] = 'modules.form.lib.js.date-picker.jquery-datePicker';
     $scriptArray[] = 'modules.form.lib.js.form';
     $markup = $form->getMarkup();
     if (!$markup) {
         $markup = 'default';
     }
     try {
         $template = TemplateLoader::getInstance()->setMimeContentType(K::HTML)->setPackageName('modules_form')->setDirectory('templates/markup/' . $markup)->load('Form');
         $template->setAttribute('form', $form);
         $template->setAttribute('selfUrl', $_SERVER['REQUEST_URI']);
         if ($formRequest->hasParameter(form_FormConstants::BACK_URL_PARAMETER)) {
             $template->setAttribute('backUrl', $formRequest->getParameter(form_FormConstants::BACK_URL_PARAMETER));
         } else {
             $template->setAttribute('backUrl', $_SERVER['HTTP_REFERER']);
         }
         if (!is_null($errors)) {
             $template->setAttribute('errors', $errors);
         }
         $fieldContents = array();
         $this->buildContentsFromRequest($form->getDocumentNode()->getChildren(), $fieldContents, $formRequest, $form);
         $template->setAttribute('requestParameters', $formRequest->getParameters());
         $template->setAttribute('elements', $fieldContents);
         return $template->execute(true);
     } catch (Exception $e) {
         Framework::exception($e);
     }
     return null;
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:42,代码来源:FormService.class.php

示例4: field

 /**
  * Generate a field element from the provided template and attributes.
  * @param string $template
  * @param array<string,string> $attributes
  * @return string
  */
 private static function field($template, $attributes)
 {
     $templateObject = TemplateLoader::getInstance()->setPackageName('modules_form')->load('Form-Field-' . $template);
     $templateObject->setAttribute('field', $attributes);
     $templateObject->setAttribute('moduleName', self::getModuleName());
     return $templateObject->execute();
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:13,代码来源:FormHelper.class.php


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