本文整理汇总了PHP中SearchForm::unsetValidator方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchForm::unsetValidator方法的具体用法?PHP SearchForm::unsetValidator怎么用?PHP SearchForm::unsetValidator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchForm
的用法示例。
在下文中一共展示了SearchForm::unsetValidator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SearchPlusForm
function SearchPlusForm($name = "SearchForm", $fieldName = "Search", $fieldLabel = '')
{
$action = $this->getRequest()->param("Action");
$page = SearchPlusPage::get()->first();
if ($page) {
//!in_array($action, array("login", "logout")) &&
if (!$fieldLabel) {
if (isset($_REQUEST[$fieldName])) {
$searchText = $_REQUEST[$fieldName];
//we set $_REQUEST["Search"] below because it is also used by things like Text::ContextSummary
$_REQUEST["Search"] = $_REQUEST[$fieldName];
} elseif (isset($_REQUEST["Search"])) {
$searchText = $_REQUEST["Search"];
} else {
$searchText = 'Search';
}
} else {
$searchText = '';
}
$field = new TextField($fieldName, $fieldLabel, $searchText);
$fields = new FieldList($field);
$actions = new FieldList(new FormAction('results', 'Search'));
$form = new SearchForm($this, $name, $fields, $actions);
$form->setFormAction($page->Link() . "results/");
$form->setPageLength(Config::inst()->get("SearchPlusPage", "result_length"));
$form->unsetValidator();
return $form;
} elseif (!$page) {
user_error("You need to create a SearchPlusPage to have a search box", E_USER_NOTICE);
}
}