Scott Christensen - 2005-10-10 16:11:40 -
In reply to message 1 from Giuliano Bortolassi
Sorry! Looking at the documentation, it is not at all clear (I must have been getting bored of writing documentation at that time).
What you need to do is replace the value of the 'view.showHello.success' configuration property. Change it from 'com.example.views.SubmitFormView' to a file called something like 'helloWorld.html'. This should correspond to a physical file (in the classpath) that you would like to display to the browser. In other words, you need to make a file called 'helloWorld.html' and put it somewhere that Phramework can find it (classpath).
The name of the file is not important, but the extension is (html). Phramework will look at the extension of the file and first try to find a view plugin that should handle those extensions. If none is found then Phramework assumes it is a class and tries to import it.
Since we told Phramework that all views with an extension of 'html' should be handled by the 'com.example.plugins.HtmlPlugin' class Phramework will look at 'helloWorld.html', see that it has an 'html' extension and subsequently call the 'com.example.plugins.HtmlPlugin' class, passing in the data as well as the value of the view ('helloWorld.html').
It is not a full replacement of the first example. It is just an extension to the first example. To be a full replacement, you would have to define another action that would take the results of filling out the form (from the first page 'helloWorld.html') and then generate the response to the browser based on the input via another view (or view plugin).
I will definitely rewrite that section and get it out to PHP Classes (text format) and Freshmeat (in pdf format).
Let me know if it doesn't make sense.
Thanks,
Scott