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(); }
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(); }