Esempio n. 1
0
 public function beforeRender()
 {
     $this->attributes->action = Router::uri('blogSearch', array('q' => ''));
     if (!empty($this->controller->params['q'])) {
         $this->q->value($this->controller->params['q']);
     }
     return parent::beforeRender();
 }
Esempio n. 2
0
 public function beforeRender()
 {
     // add optional to all non mandatory fields
     foreach ($this->fieldset->children() as $FormField) {
         if ($FormField instanceof FormField && !in_array($FormField->type, array('checkbox', 'submit')) && !$FormField->mandatory) {
             $FormField->label .= ' ' . __('(optional)');
         }
     }
     return parent::beforeRender();
 }