|Copyright © 2008, Levyco Development, LLC. All rights are reserved.|
This is some common background information that will help you understand some of the lower-level details about the implementation of these pages. This understanding is not necessary to use or understand the YUI elements, but may be useful if any of the PHP functionality is of interest to you.
I use PHP on the server to handle AJAX requests, primarily, but I also have a page framework, some "helper functions" and some global variables that are used on these pages for simplicity. However, none of this is necessary for the purposes herein, it just makes my life easier (which is a good thing!). I'm going to show some of the code with PHP snippets interspersed, and I will show the actual HTML generated too (you can "view source" for the page to see the ultimate HTML output too, of course).
Also, as part of my framework, I have a module that "figures out" what YUI elements will be needed on the page. This is a server-side equivalent of the YUI Dependency Configurator tool. I had already developed my tool before that showed up (or at least before I found it), so I have stayed with my tool. I begin each "page" with something like this:
This array of module requirements gets sent to the page framework to generate the actual YUI requirements, resulting in this code: