From: Shannon W. <we...@ro...> - 2005-04-25 17:13:44
|
Bob Doan wrote: >>How hard would it be to be to make this optional? I can take a look at >>doing it if you want to suggest a plan of attack. > > > The Easy Part: > > I would do it w/ an output parameter, similar to "trim_links" and > "meta". Everything you need is in html.c > > Basically you want to IF around the head tags and stuff. > > Yep, this part I imagined and could probably pull off fairly easily. > > The Hard(er) parts: > rlib_spool in PHP basically it's a call to php_write. This probably > won't due in your case depending on how PHP (and possibly your > implementation of PHP) cache output. So you will have to make bindings > for: > > rlib_get_output_length > rlib_get_output > This isn't a problem, I'm already using the built in output buffering functions to capture it, like this: ob_start(); rlib_spool($rlib); $rData = ob_get_contents(); ob_end_clean(); Which works fine. > > RLIB relies on some style stuff in the HEAD tag. This could be a > problem, in which case you probably want to SPLIT the output into the > HEAD and the BODY. If this is really what you want to do then there is > going to be a little more work. I'm not sure where else you can put > <style> tags off the top of my head. If you can put them in the body we > are good to go and we don't need to SPLIT output. > This is the larger problem. The HTML standard doesn't support putting the STYLE tag anywhere but in the HEAD. You can however use a linked style sheet or do it inline. The inline may work but rlib would have to support that at various places in the code. The linked style sheet may also work -- if rlib could return a string to php that had the style sheet, it could be written out to a place readable by the web server. Not all that clean, though. I think splitting the output sections into HEAD and BODY in rlib is the cleanest long term solution. Or better yet, some sort of template system. Unfortunately it's probably too much work for my time frame (any volunteers? :) I'll have to think about it and see if I can find a way around it for now. Thanks, Shannon |