Re: Is there a way to display data from database for SelectOptions in a form?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Paulson (CE CEN) wrote:
[snip]Let's look at it another way, why 70-80 lines of code when 4 will do it
properly when done correctly?[/snip]

4 * 20 = 80
so after having created 20 dynamic select boxes the function wins it.
I really don't think that performance here is the issue - one should tackle
that with suitable caching not writing unmanagable speed-freak-code.

on top of that there is a high chance that the 4 lines will be copy/pasted
quite often - a great way to replicate small little errors. in contrast to the
function which keeps the 'template' HMTL output (of the select box) in
a single place (handy for making site wide changes - for instance all a requirement
that means all selectboxes must have a certain class attribute value?)

another advantage of the function is that it takes into account
attributes/functionality that you might not need in this particular case now -
but might come in handy. using the function means not having to hack stuff
in later)


I agree with this line of thinking especially for a new person to php.

When I first read the solution that was so long I thought to myself "great and this person is new to php and now they are going to be scared of php."

Sue ....

DON'T PANIC (sorry for the lack of friendly letters)

(the fear argument doesn't wash with me btw; if Sue has more questions she should fire away!)
(with regard to fear: go read some Krishnamurti or have children or something - either you go
mad or you get over it ;-)


I really think one of the appeals of php is it's simplicity of getting things done and getting those things done quickly.
Yes it's great having one function to output every select html form but is it really necessary?

sheesh - it's not [YouMustBeJokingIfYouThinkDevelopingWithThisIs]QuickForm
(the 'YouMustBeJokingIfYouThinkDevelopingWithThisIs' is silent ;-)





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux