本文整理汇总了PHP中MailForm::createWidget方法的典型用法代码示例。如果您正苦于以下问题:PHP MailForm::createWidget方法的具体用法?PHP MailForm::createWidget怎么用?PHP MailForm::createWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailForm
的用法示例。
在下文中一共展示了MailForm::createWidget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MailForm
global $cgi;
loader_import('saf.MailForm');
$form = new MailForm();
$w =& $form->addWidget('hidden', 'appname');
$w->setValue($parameters['appname']);
foreach ($settings as $k => $v) {
if (!isset($v['type'])) {
$v['type'] = 'text';
}
if (isset($v['value'])) {
$val = $v['value'];
unset($v['value']);
} else {
$val = false;
}
$w =& $form->createWidget($k, $v);
if ($val) {
$w->setValue($val);
}
}
$sub =& $form->addWidget('msubmit', 'submit_button');
$b1 =& $sub->getButton();
$b1->setValues(intl_get('Save'));
$b2 =& $sub->addbutton('submit_button', intl_get('Cancel'));
$b2->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/usradm-applications-action\'; return false"';
if ($form->invalid($cgi)) {
$form->setValues($cgi);
echo $form->show();
} else {
$vals = $form->getValues();
foreach ($vals as $k => $v) {
示例2: array
$attrs = array_merge($attrs, $defaults);
}
$css = new CSS_Parser();
$classes = array();
$ids = array();
foreach (Dir::find('*.css', 'inc/html/' . conf('Server', 'default_template_set')) as $file) {
$css->parse(@join('', @file($file)));
$classes = array_merge($classes, $css->getClasses($cgi->tag));
$ids = array_merge($ids, $css->getIDs($cgi->tag));
}
$classes = array_unique($classes);
$ids = array_unique($ids);
$form = new MailForm();
ini_add_filter('ini_filter_split_comma_single', array('rule 0', 'rule 1', 'rule 2', 'rule 3', 'rule 4', 'rule 5', 'rule 6', 'rule 7', 'rule 8', 'button 0', 'button 1', 'button 2', 'button 3', 'button 4', 'button 5', 'button 6', 'button 7', 'button 8', 'submitButtons'));
foreach ($attrs as $attr) {
$w =& $form->createWidget($attr->name, ini_parse($attr->typedef, false));
if (isset($cgi->{$attr->name})) {
$w->setDefault($cgi->{$attr->name});
}
}
ini_clear();
if (isset($form->widgets['id'])) {
$form->widgets['id']->setValues(array_merge(array('' => '- ' . intl_get('SELECT') . ' -'), assocify($ids)));
}
if (isset($form->widgets['class'])) {
$form->widgets['class']->setValues(array_merge(array('' => '- ' . intl_get('SELECT') . ' -'), assocify($classes)));
}
$w =& $form->addWidget('hidden', 'ifname');
$w->setValue($cgi->ifname);
$w =& $form->addWidget('hidden', 'tag');
$w->setValue($cgi->tag);