|
Pike Processing Instruction
The <?pike ... ?> processing instruction tag (PI for short) is used to smoothly inline pike code in your pages. The perhaps most usable aspect of this is for quickly throwing together a small webpage application or for experimenting and toying around with the roxen programming environment. Since the code resides in the page, it will not be so reusable a component, as would a Roxen module, but the short cycle time between applying a change and seeing the results right after another page reload make it an ideal development tool. MethodsThree additional methods set the Pike PI tag apart from those present everywhere else within Roxen. These handle the output facilities of the tag:
Special Variables
For meshing pike, RXML code and common HTML, there are other convenience features present, in the form of certain comments treated specially. //O (the letter O) comments are written out directly into the page, and //X comments are parsed as RXML on the spot and written out into the result page. These shorthands are equivalent to the calls write(my_string) and write(rxml(my_string)) respectively. An example pike processing instruction that shows some server info and toggles the value of a cookie: <?pike//X <gtext>Server Info</gtext><br /> write("This is %s running %s, and we've been up for %d seconds.", roxen.version, roxen["pike-version"], roxen.uptime); //X <br /><gtext>Cookies</gtext><br /> //X <pre><insert scope='cookie' variables='full' /></pre> if(cookie.hi == "Hi!") cookie.hi = "Ho!"; else cookie.hi = "Hi!"; ?> |
|||||