Re: common method names
| From: | Bertrand Mansion | Date: | Wed, 05 Mar 2003 09:59:23 +0000 |
| Subject: | Re: common method names | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14080@lists.php.net to get a copy of this message | ||
<wolfram@visionp.de> wrote :
> i was just using HTML_TreeMenu and QuickForm
> and i realized that in TreeMenu you print the menu using
> $treeMenu->printMenu()
> but in QuickForm you need to use
> $form->display()
>
> should there not be a common name for both?
> i would suggest display() or toHtml()
>
> any comments?
As you might guess, I am in favour of toHtml() when one need a string and
display() when one need this string echoed. ;) We used this scheme in
HTML_Table, HTML_Common, HTML_QuickForm and Config. Plus other methods like
toArray() from time to time.
Have a nice day,
Bertrand Mansion
Mamasam