Page.phpファイルで検索フォームを定義しました
function AdvancedSearchForm(){$ searchText = isset($ this-> Query)?$ this->クエリ:'検索'; $ searchText2 = isset($ this-> Subquery)?$ this-> Subquery: '0'; $ searchText3 = isset($ this-> documentType)?$ this-> documentType:'すべて';
$searchSections = DataObject::get('SearchSection');
$ss = array();
foreach ($searchSections as $section) {
$ss[$section->ID] = $section->Name;
}
$fileTypes = DataObject::get('FileType');
$ft = array();
foreach ($fileTypes as $type) {
$ft[$type->ID] = $type->Name;
}
$ft[0] = 'All';
ksort($ft);
$fields = new FieldSet(
new TextField('Query','Keywords', $searchText),
new DropdownField('Subquery', '', $ss, $searchText2),
new DropdownField('documentType', '', $ft, $searchText3)
);
$actions = new FieldSet(
new FormAction('AdvancedSearchResults', 'Search')
);
$form = new Form($this->owner, 'AdvancedSearchForm', $fields, $actions);
$form->setFormMethod('GET');
$form->setTemplate('Includes/SearchForm');
$form->disableSecurityToken();
return $form;
}
そして、私のすべてのページはページから拡張され、検索フォームはヘッダーにあるので、すべてのページに表示されます。しかし、ユーザーがセキュリティ/ログインページを表示して何かを検索しようとすると、次のエラーメッセージが表示されます。
The action 'AdvancedSearchForm' does not exist in class Security
これは、セキュリティページがページから拡張されていないためだと思います。セキュリティログインページなどのシステムページを含むすべてのページで機能するように、から検索を設定するにはどうすればよいですか?