本文整理汇总了PHP中HtmlForm::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlForm::setId方法的具体用法?PHP HtmlForm::setId怎么用?PHP HtmlForm::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlForm
的用法示例。
在下文中一共展示了HtmlForm::setId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($par)
{
$request = $this->getRequest();
$context = $this->getContext();
$output = $this->getOutput();
$output->addModules('ext.MassMessage.special.js');
$output->addModuleStyles('ext.MassMessage.special');
$this->setHeaders();
$this->outputHeader();
$this->checkPermissions();
// Some variables...
$this->status = new Status();
// Figure out what state we're in.
if ($request->getText('submit-button') == $this->msg('massmessage-form-submit')->text()) {
$this->state = 'submit';
} elseif ($request->getText('preview-button') == $this->msg('massmessage-form-preview')->text()) {
$this->state = 'preview';
} else {
$this->state = 'form';
}
$form = new HtmlForm($this->createForm(), $context);
$form->setId('mw-massmessage-form');
$form->setDisplayFormat('div');
if ($this->state == 'form') {
$form->addPreText($this->msg('massmessage-form-header')->parse());
}
$form->setWrapperLegendMsg('massmessage');
$form->suppressDefaultSubmit();
// We use our own buttons.
$form->setSubmitCallback(array($this, 'callback'));
$form->setMethod('post');
$form->prepareForm();
$result = $form->tryAuthorizedSubmit();
if ($result === true || $result instanceof Status && $result->isGood()) {
if ($this->state == 'submit') {
// If it's preview, everything is shown already.
$msg = $this->msg('massmessage-submitted')->params($this->count)->plain();
$output->addWikiText($msg);
$output->addWikiMsg('massmessage-nextsteps');
}
} else {
$form->displayForm($result);
}
}