本文整理汇总了PHP中HtmlForm::addLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlForm::addLabel方法的具体用法?PHP HtmlForm::addLabel怎么用?PHP HtmlForm::addLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlForm
的用法示例。
在下文中一共展示了HtmlForm::addLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlPage
$page = new HtmlPage('Useless defaultsorts');
// create new database object
$db = new Database();
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);
$rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$page->addInline('p', 'This tool generates a list of DEFAULTSORT keys that match the page title exactly.');
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('project', 'Project');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'View useless defaultsorts');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
示例2: RequestValidator
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);
$rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);
$rq->addAllowed('GET', 'page', '', '', true, false);
$rq->addAllowed('GET', 'since', '0000-00-00', '/^\\d{4}-\\d{2}-\\d{2}$/', false, false);
$rq->addAllowed('GET', 'until', '0000-00-00', '/^\\d{4}-\\d{2}-\\d{2}$/', false, false);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$page->addInline('p', 'This tool creates a list of contributors to a given article on a given project in wikitext.');
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('project', 'Project');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('page', 'Page title');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('page', $par['page'], 'A page title in the main namespace (0)', 0, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('since', 'Revisions since');