Nifty Functions - Where do they go?

1 view
Skip to first unread message

Computer Guru

unread,
Jan 11, 2007, 6:50:50 AM1/11/07
to habar...@googlegroups.com

Nifty functions that can be used almost everywhere, generic purposes. Which class would they go in?

 

For instance, I’m looking to get rid of all uses of code like:
<?php echo ($post->status == Post::STATUS_DRAFT) ? 'checked="checked"' : ''; ?>

(from publish.php, it’s job is to check if the option is selected, and if so, add a value=checked to it)

 

And replace that with something like this:

<?php echo optionIsChecked($post->status == Post::STATUS_DRAFT) ?>

 

Which class would functions of the likes of “optionIsChecked” go in?

 

Computer Guru

NeoSmart Technologies

http://neosmart.net/blog/

 

Robert Deaton

unread,
Jan 11, 2007, 7:34:20 AM1/11/07
to habar...@googlegroups.com
Probably Utils, unless we end up making a series of functions similar
to that large enough that it merits its own FormHelper class or
somesuch.


--
--Robert Deaton
http://lushlab.com

Reply all
Reply to author
Forward
0 new messages