Re: DB_DataObject_FormBuilder: reorderElements, preDefOrder
| From: | Markus Wolff | Date: | Fri, 07 Nov 2003 09:32:36 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder: reorderElements, preDefOrder | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-23324@lists.php.net to get a copy of this message | ||
Mocsnik Norbert wrote:
Is there a reason to check if preDefOrder contains as many fields as the DataObject itself does? If this check is left out, it is possible to use this variable for indicating which fields to render, instead of implementing one more variable ("fields_to_display") in the future.
function _reorderElements() {
if(isset($this->_do->preDefOrder)
&& is_array($this->_do->preDefOrder)
&& count($this->_do->preDefOrder)== count($this->_do->table())) {
..
In short, if I have 10 fields and I do
$do->preDefOrder = array('firstfield', 'secondfield');
then I'm sure I want to display only these fields and I did not write it wrong.
Hmm... so what about the other fields, then? Do you just want not to _display_ them (i.o.w.: make them "hidden") or do you want to not have them in the form at all (which would also mean that the values of these fields, if set in the dataobject, cannot be passed through the form)?
CU
Markus