Version: current

     1 <?php
     2 // Расширение для показа формы поиска на всех страницах сайта
     3 class WebylonSiteSearchExtension extends Extension {
     4     function extraStatics() {}
     5
     6     function SiteSearchForm($extra=null) {
     7         $controller = new Search_Controller();
     8         $form = $controller->SearchForm();
     9         $form->setTemplate('SiteSearchForm');
    10         $htmlID = 'SiteSearch';
    11         if ($extra) {
    12             $form->addExtraClass($extra);
    13             $htmlID .= "_{$extra}";
    14         }
    15         $form->setHTMLID($htmlID);
    16         if ($this->owner->getRequest()) {
    17             $form->loadDataFrom($this->owner->getRequest()->requestVars());
    18         }
    19         return $form;
    20     }
    21 }
    22

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -