示例#1
0
文件: Email.php 项目: vigm/advancedMD
 /**
  * Renders the portion of a form that contains the elements for listing
  * a template's variables. This is especially useful for tabbed forms.
  *
  * @param TemplateModel $template A Template entity
  * @param bool|ValidationResult $errors FALSE (if nothing was submitted) or
  *   a ValidationResult object. This is needed to render any inline erorrs
  *   on the form.
  * @return string HTML
  */
 private function renderVariablesPartial($template, $errors)
 {
     $html = '<ul class="arrow-list">';
     foreach ($template->getAvailableVariables() as $variable) {
         $html .= '<li><a href="">{' . $variable . '}</a></li>';
     }
     $html .= '</ul>';
     $section = array(array('title' => 'variables', 'desc' => 'variables_desc', 'fields' => array('variables' => array('type' => 'html', 'content' => $html))));
     return ee('View')->make('_shared/form/section')->render(array('name' => NULL, 'settings' => $section, 'errors' => $errors));
 }