where to put a function
| From: | Rick Pasotto | Date: | Mon, 14 Apr 2008 15:34:49 +0000 |
| Subject: | where to put a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-272976@lists.php.net to get a copy of this message | ||
Probably been answered a thousand times; if so, just tell me where to
look.
I have a function that includes a specific sql query that is used on
only one page on the site. Should that function be coded (1) in the page
itself, (2) in a separate file that only that page includes, or (3) in a
master file that contains all the functions used on the site and is
included on every page?
I've been doing #1 (not actually a function in this case) but #3 is
appealing, especially since I would implement it as OOP and the page
itself would be really just a template. What is the cost of parsing a
bunch of functions that are not used on a given page load?
--
"If some peoples pretend that history or geography gives them the right
to subjugate other races, nations, or peoples, there can be no peace."
-- Ludwig von Mises
Rick Pasotto rick@niof.net http://www.niof.net