|
Posted by Jon Slaughter on 05/21/07 15:57
"Umberto Salsi" <salsi@icosaedro.italia> wrote in message
news:f2r9e7$64q$1@nnrp.ngi.it...
> "Jon Slaughter" <Jon_Slaughter@Hotmail.com> wrote:
>
>> Again, the main idea is to treat form evaulation as inline instead of on
>> a
>> seperate page. In this way one encapsulates the function of the form with
>> the form itself. [...]
>
> I agree with you that embedding all the code that handle related WEB pages
> (the typical example is handling the loop form display, validation, error
> reporting, acquisition of the data) is very powerful, and it can
> implemented
> in several ways. Adding "embedded strings with PHP code" may be a pain,
> as you experienced. But things can be improved. Some idea follows.
>
>
> [ Function bound to an URL ]
>
> Rather than add chunks of code as inline strings and send them as cookies,
> you might want to consider to associate every "action" to a PHP function.
> That is what i called "programming the WEB application by functions".
>
No, you misunderstand, the cookies are just cookies for the data. It uses
code to evalude data that is to be stored. I call it dynamic data.
> Then a single PHP source may contain several functions calling each other
> via "actions". For example, this function generates a page with 3 anchors
> that, once selected by the user, causes the correspondin function/action
> handler to be called; handlers can have also arguments:
>
This is similar to what I had in mind to some degree. I did not want to make
a function for every thing that would be used. For example, I did not want
to code up a html form in php and supply the functions to the user to be
used.
Essentially I did not want to wrap html code because I feel its just an
extra layer of dead weight. That is, unless it serves a purpose. I did have
that idea though but just wasn't sure if it would be a good idea or not. On
one hand it does make things much easier but on the other it could be to
restrictive.
My initial idea was to implement some type of framework .NET for php and
html. One could have an visual IDE to create pages but the code would be
all be php. I feel that this might just be to much work and it would be
overkill. php is a scripting language and not ment to do what html easily
does. Although it might be something worth while to work on.
Of course with my idea the user can create there own functions to call sorta
like what you do but you supply the functions for them. Its more robust but
more complicated and confusing too. If PHP had something like C++ templates
then it probably could be a very powerful thing and really remove all the
problems that html has.
Thanks,
Jon
[Back to original message]
|