如何在CiviCRM表单中添加静态html标记


How to add static html markup to a CiviCRM form

我有CiviCRM 4.4.6 + Drupal 7,我改变了CiviCRM的一个表单。

Inside hook_civicrm_buildForm(), i try:

form->addElement('html', 'statichtml', '<div>aa</div>');
$template =& CRM_Core_Smarty::singleton();
$bhfe = $template->get_template_vars('beginHookFormElements');
if (!$bhfe) {
  $bhfe = array();
}
$bhfe[] = 'statichtml';
$form->assign('beginHookFormElements', $bhfe);

如果我使用'text'元素类型,它可以正常工作。这样就不会渲染任何内容,但是会添加一个空的附加tr。如何正确使用这种类型的元素?

http://pear.php.net/manual/hu/package.html.html-quickform.intro-elements.php下面是解释。元素类型应该是static,而不是html,以上代码开始工作