Re: Question about QuickForm Renderers

From: Date: Thu, 28 Aug 2003 20:48:15 +0000
Subject: Re: Question about QuickForm Renderers
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-7452@lists.php.net to get a copy of this message
Hi yourself and thanks for responding! Alexey Borzov wrote: > Hi! > > 1) The problem with private variables is that they are, uh, private. ;] > 2) In case the comment "HTML for the current group" does not ring any > bells, this template is assigned to in startGroup() method, line 323: > $this->_groupTemplate = $this->_prepareTemplate($name, $group->getLabel(), > $required, $error); > I realize they're private. I least that's what the underscore denotes, or am I mistaken? I am really just trying to create my own renderer so having my own private vars is not a big deal is it? Or is the suggested method to use the method of instatiating a renderer and modifying it with setElementTemplate et. al.? > > > Yep, laziness is programmers virtue. ;] > Not so much laziness as stupid mistake prevention. Code reuse is nice but you only have to write it the correct way once is a better benifit to me. I make too many silly mistakes sometimes. > > You can try hacking line 325 of Default.php: > $this->_groupWrap = empty($this->_groupWraps[$name])? '': > $this->_groupWraps[$name]; > > Insert your default template instead of '' here. > > Or better yet, consider using some template-engine-based renderer. > That's probably what I'll have to do but it would be much easier to change the vars at the top of the class instead of having to remember where I changed them. I guess my real question is why does setting it where it seems to make the most sense in the class file not work. Maybe an @desc that says "This actually does nothing if set here" is more appropriate ;) > Don't quite get you here: what is the group header? Maybe the proper term is "group label"? The part I'm refering to is: $form->addGroup($name, 'name', 'Name (first or last or both):', '&nbsp;'); the third value passed to addGroup. Does that value have a get Method? I could use that in my own renderer such as: <fieldset> <legend>$this->groupLabel</legend> or somesuch. I apologize if I came off too strong in the asking of my question. The QuickForm team has done a wonderful amount of work and has been a lifesaver for me on this project. I don't want to sound ungrateful at all. Thanks again for all the responses and I've also just realized that php.pear.general is only an nntp interface to the actual mailing list. As soon as the mailserver setup will let me subscribe properly, I'll simply join the list. No need to followup to my personal email BTW as I've got everything setup at home now. Thanks again and I look forward to your responses, John E. Vincent

« previous php.pear.general (#7452) next »