For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > November 2004 > Re: [PEAR] QuickForm Multiple Rendering of elements in standard HTML- Possible?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] QuickForm Multiple Rendering of elements in standard HTML- Possible?
Justin Patrin

2004-11-29, 4:04 pm

On Sat, 27 Nov 2004 23:35:00 -0600, Jim Tom Polk <datdone@camalott.com> wrote:
> Is is possible to display or render QuickForm elemnts IN the HTML
> structure of a web page, somehow having them bound together so that you
> could display/render the beginning of the form and it's attributes, then
> the elements IN a table.
>
> It would be like for each element have it rendered as bare, with rules
> and filters, then display, over and over again, yet linked?
>
> The reason is that I want to more accurately show where they will
> actually appear in a web pages design, in a WYSIWYG environment, rather
> than programming the template and the elements.
>
> I have found that I find describing what I want the HTML to look like
> with programming is easy, but is very difficult to imagine for many people.
>
> What I am trying to do is embed QuickForm into a WYSIWYG environment as
> much as possible. The environment is Adobe GoLive.
>
> Basically, I'm at the point where I can put a rectangle into a page, the
> rectangle being defined as a custom HTML element and inside it, PHP
> coding that when the rectangle has focus, you will be able to "inspect"
> it to modify strings using a GUI dialog.
>
> Something like this:
>
> <glp.el><?php
> $GLPuploadFORMNAME->addElement('text','title','Title:';
> $GLPuploadFORMNAME->addRule('title','You must supply a title','required');
> $GLPuploadFORMNAME->applyFilter('title',trim);
> ?></glp.el>
>
> ...where FORMNAME, and the variables for addElement,addRule and
> applyFilter are modified via a GUI inspector, and when the file is
> uploaded, the non-valid HTML (<glp.el></glp.el> ) is stripped. You put
> these one after the other, add a predefined process upon validaion, and
> then do display, etc.
>
> So, a designer could easily create a table and put the elements in it,
> modifying the table attributes using famaliar tools, rather than having
> to imagine and piece together what the wanted by modifying the default
> tempalates.
>
> I hope this makes some sense, and if so, is it something tha is
> possible, and if possible, would the processing overhead be to high.
>


Well....it is possible to use a template system to do this. You can
use the Array renderer for QuickForm or the ArraySmarty renderer. You
could very easily put in a placeholder in which outputs the pieces,
then process the template through Smarty. See the renderer docs and
examples in the QF package.

--
Justin Patrin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com