コード例 #1
0
 protected function createForm()
 {
     if ($this->form === null) {
         $base = $this->app->config->blorg->path;
         $keywords = new SwatSearchEntry();
         $keywords->id = 'keywords';
         if (isset($_GET['keywords'])) {
             $keywords->value = $_GET['keywords'];
         }
         $field = new SwatFormField();
         $field->title = $this->getValue('label');
         $field->add($keywords);
         $button = new SiteUnnamedButton();
         $button->id = 'search_button';
         $button->title = 'Search';
         $this->form = new SiteSearchForm();
         $this->form->id = 'search_form';
         $this->form->action = $base . 'search';
         $this->form->setMethod(SiteSearchForm::METHOD_GET);
         $field->add($button);
         $this->form->add($field);
     }
 }