Re: Quickform textarea formatting
| From: | Bertrand Mansion | Date: | Thu, 13 Feb 2003 18:20:41 +0000 |
| Subject: | Re: Quickform textarea formatting | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3754@lists.php.net to get a copy of this message | ||
le 13/02/03 18:37, Dan Wilson à dan@acucore.com a écrit :
> Quoting Bertrand Mansion <bmansion@mamasam.com>:
>
>> le 13/02/03 16:45, Dan Wilson à dan@acucore.com a écrit :
>>
>>> Can we add a getElementTemplate function? That way, I can pull back the
>>> current value, manipulate it and then set it with setElementTemplate. I
>> know
>>> I can get to this through the actual variable _elementTemplate, but that's
>> not
>>> good OOP, and it might not be supported in PHP5.
>>
>> Sure, we can add that. I don't really see what you want to do with it.
>> Can't you just use $form->setElementTemplate(with nowrap, 'myElement');
>> and
>> do your manipulation in your code.
>
> That's my whole point... in order for me to do the 'with nowrap', I need to be
> able to strip that out. I'd much rather strip it out of the existing
> template, and then set it back in. I want it to remain exactly the same,
> except for the nowrap. So it would look something like this:
>
> $form->setElementTemplate(str_replace('nowrap="nowrap"', '',
> $form-
>> getElementTemplate('myEl')), 'myEl');
>
> Hey... here's a idea: How bout we leave off the nowrap and then we can detect
> a group element and set the nowrap for that specific element, rather than
> having it there for everything. What do you think of that?
I think I'll add the getElementTemplate() method and let you do the
str_replace :) I wouldn't like to have to add to many exceptions to the
code, groups and standard elements are already difficult to handle.
>>> PS. I sent you an email a few months or so ago that included some code to
>>> allow for default attributes for given types. I never got a response. Did
>>> you not get that?
>>
>> I don't remember receiving it, it might have been blocked by my server.
>> Could you please post it again. TIA
>
> I will have to dig it up...
This can be a useful addition, I'll take care of that too.
Thanks,
Bertrand Mansion
Mamasam