<ralphdahlgren.com>
<ralphdahlgren.com>
This section will provide access to Snippet resources. Snippets are PHP scripts, large, small, or in between, which can be called from within other Etomite resources to perform specific tasks. Common uses might include dynamic navigation generation, data abstraction and display, guestbooks, blogs, or photo galleries, to name just a few. Essentially, any stand-alone PHP script can be transformed into a snippet.
So, what makes a snippet differ from a stand-alone PHP script? There are only several differences and once the guidelines are understood it becomes quite easy to write snippets proficiently. Snippets don't require opening and closing PHP tags. Snippets cannot contain direct output functions like echo or print because Etomite utilizes output buffering and these functions attempt to write directly to the output device, bypassing the output buffer. Concatenation of data into a variable, $output being the Etomite standard, and then returning the variables contents to the caller is the preferred method of handling data intended for display.
Snippets in this section: