forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Quick way to skin php-files?
Date Tue, 29 Nov 2005 10:38:10 GMT
Ferdinand Soethe wrote:
> David Crossley wrote:
> 
> 
>>I gather that you are saying that the XML Processing Instructions
>>(PI) get stripped somewhere by one of the transformations.
> 
> 
> No, they pass through ok if I embedd them into an html-page. Problem
> is that the final page needs to have the .php-extension for the Server
> to process it correctly. And when I change the extension of the file
> from html to php our pipelines don't want to skin it anymore. Too many
> extension-based matchers along the route I suppose.

If you have control over the server you can control which pages ares 
processed by the PHP engine. However, changing it to process all html 
pages would be a performance problem since I guess many HTML files will 
not contain PHP elements.

If I understand correctly you want to have Forrest generate *.php files 
which will then be processed by the PHP engine. That is Forrest is *not* 
processing the PHP itself. It is easy to create a pipeline for this. 
Rather than sharing the code offlist can I suggest that the relevant 
pipeline snippets are shared online so that others can benefit (better 
still submit a plugin to the project).

In the absence of this, all you (should) need to do is copy the two HTML 
matchers in sitemap.xmap (pattern="*.html" and pattern="**/*.html") with 
identical matchers put looking for the php extension, i.e. 
pattern="*.php" and pattern="**/*.php"

Then, in each place where {0} appears change it to {1}.html (this is 
because {0} includes the extension of the match). This assumes that our 
internal processing allows the PHP tags to pass through corectly. You 
appear to confirm this above.

Note, this will result in any document that would normally be processed 
by Forrest to create an HTML page being able to include PHP elements as 
well (assuming that you can encode them in the source format of course). 
FOr example, if you turn of validation you could include the elements in 
an XDoc.

WARNING
This is untested, but would be where I would start experimenting and I'm 
pretty sure is close to correct (maybe even correct ;-).

Ross

Mime
View raw message