【发布时间】:2014-07-31 15:43:44
【问题描述】:
我有 CiviCRM 4.4.6 + Drupal 7,我更改了 CiviCRM 的一种形式。
在hook_civicrm_buildForm() 内部,我尝试:
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);
如果我将它与“文本”元素类型一起使用,它可以正常工作。这样不会渲染任何内容,但会添加一个空的附加 tr。
如何正确使用这类元素?
【问题讨论】: