本文整理汇总了PHP中HTML_QuickForm::getElementValue方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm::getElementValue方法的具体用法?PHP HTML_QuickForm::getElementValue怎么用?PHP HTML_QuickForm::getElementValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_QuickForm
的用法示例。
在下文中一共展示了HTML_QuickForm::getElementValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addButtons
/**
* Append action buttons to the end of this form
*
* @param bool|null $valid Whether the form was validated
*/
private function _addButtons($valid)
{
$buttons = $valid === false ? $this->buttons : TIP_FORM_BUTTON_CLOSE;
$group = array();
if ($buttons & TIP_FORM_BUTTON_SUBMIT) {
$group[] =& $this->_createElement('submit');
}
if ($buttons & TIP_FORM_BUTTON_RESET) {
$group[] =& $this->_createElement('reset');
}
if ($buttons & TIP_FORM_BUTTON_OK) {
$uri = TIP::modifyActionUri(null, null, null, array('process' => 1));
$group[] =& $this->_createElement('link', 'ok', array('href' => $uri));
}
if ($buttons & TIP_FORM_BUTTON_DELETE && $this->action_id == TIP_FORM_ACTION_DELETE) {
$uri = TIP::modifyActionUri(null, null, null, array('process' => 1));
$group[] =& $this->_createElement('link', 'delete', array('href' => $uri));
}
if ($buttons & TIP_FORM_BUTTON_CANCEL) {
$group[] =& $this->_createElement('link', 'cancel', array('href' => $this->referer));
}
if ($buttons & TIP_FORM_BUTTON_CLOSE) {
$group[] =& $this->_createElement('link', 'close', array('href' => $this->follower));
}
if ($buttons & TIP_FORM_BUTTON_DELETE && $this->action_id != TIP_FORM_ACTION_DELETE) {
$data =& $this->master->getProperty('data');
$primary_key = $data->getProperty('primary_key');
$uri = TIP::buildActionUri($this->id, 'delete', $this->_form->getElementValue($primary_key));
$group[] =& $this->_createElement('link', 'delete', array('href' => $uri));
}
// Append the group of buttons to the form
$this->_form->addElement('group', 'buttons', null, $group, ' ', false);
}
示例2: array
}
$tpl = new HTML_Template_ITX('.');
$tpl->loadTemplateFile('installing.html');
$vars = array("L_SETUP_APP_TITLE" => "SW4P", "L_APPNAME" => basename(__FILE__), "L_APPCOPYRIGHT" => "© 2003 SW4P Team ");
$tpl->setVariable($vars);
$form = new HTML_QuickForm('form');
$form->addElement('submit', 'launch', 'Launch', 'style="width:100px;"');
$styles = array('none' => 'none', 'solid' => 'solid', 'dashed' => 'dashed', 'dotted' => 'dotted', 'inset' => 'inset', 'outset' => 'outset');
$form->addElement('select', 'border', 'border style:', $styles);
$colors = array('#FFFFFF' => 'white', '#0000FF' => 'blue', '#7B7B88' => '#7B7B88');
$form->addElement('select', 'color', 'border color:', $colors);
$defaultValues['border'] = 'solid';
$defaultValues['color'] = '#7B7B88';
$form->setDefaults($defaultValues);
if ($form->validate()) {
$arr = $form->getElementValue('border');
$border = $arr[0];
$arr = $form->getElementValue('color');
$color = $arr[0];
} else {
$border = $defaultValues['border'];
$color = $defaultValues['color'];
}
$bar = new HTML_Progress();
$bar->setAnimSpeed(200);
$bar->setIncrement(10);
$bar->setBorderPainted(true);
$bar->setStringPainted(true);
// get space for the string
$bar->setString('');
// but don't paint it