Hi,
I have a form to select some search options. I have a field that I
wanto to show only if the user is logged in. I want to do something
like this:
if(!$this-getUser()-hasAttribute('user'))
unset($this-form-widgetSchema['mine']);
that doesn't work because widgetSchema is protected.
hi,
you could do something nasty like
if(!$this-getUser()-hasAttribute('user'))
$tempSchema=$this-form-getWidgetSchema();
unset($tempSchema ['mine'];
$this-form-setWidgetSchema($tempSchema);
}
but this wouldn't be testable.
better solution is