PHP Classes

PLUG-IN

Recommend this page to a friend!

      Phramework  >  All threads  >  PLUG-IN  >  (Un) Subscribe thread alerts  
Subject:PLUG-IN
Summary:Questions about the use of Plugins.
Messages:3
Author:Giuliano Bortolassi
Date:2005-10-10 15:01:12
Update:2005-10-10 17:57:45
 

  1. PLUG-IN   Reply   Report abuse  
Picture of Giuliano Bortolassi Giuliano Bortolassi - 2005-10-10 15:01:12
Hello,

well, i have been set-up the class and followed the paths for the 2 examples in acctual documentation....
The first example is fine and works very well... but....

I have not understand the seccond example... how I use the HTML plugin in my applications?? Well I have been stantied the class, make the .html, setup the configuration file.. but.. how I call the plugin? where? in my action Class? How?

Well... I try to find this answers by myself.. but if anyone could help-me.. I be gratefull.



  2. Re: PLUG-IN   Reply   Report abuse  
Picture of Scott Christensen 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

  3. Re: PLUG-IN   Reply   Report abuse  
Picture of Giuliano Bortolassi Giuliano Bortolassi - 2005-10-10 17:57:45 - In reply to message 2 from Scott Christensen
Welll welll well... nice... I like this!!!
So.. all I need is change:

view.showHello.success=com.examples.views.SubmitFormView
to
view.showHello.success=formpage.html

(following your documentation)...

well.. its work... very nice...

I will test this class a bit more... maybe its usefull in my job...

thanks!!

Well, if you need help to translate the documentation... I´m here....

bye!