QuickFormController Privates? - Re: [PEAR-BUG] #60 [Asn]: varname error (and limitation)

From: Date: Sun, 05 Oct 2003 14:10:01 +0000
Subject: QuickFormController Privates? - Re: [PEAR-BUG] #60 [Asn]: varname error (and limitation)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22383@lists.php.net to get a copy of this message
Can someone that knows QF Controller explain this.. ?
and I've not come up with any good reason _yet_ for changing it.. :)
One reason might be so you can use Flexy as a renderer for QuickFormController (without hacking around) .. :) It makes buttons that start with '_qf_'. The problem is that starting with a underscore does not always mean 'private', but is also used for namespace reasons ... Greetings, Jeroen. Previous Comments: ------------------------------------------------------------------------ [2003-10-04 09:57:01] alan_k@php.net Documentation issue Yes it is by design.. - Private variables/methods should not be accessable.. It made sense at when I designed the parser to do this.. and I've not come up with any good reason _yet_ for changing it.. :) Regards Alan ------------------------------------------------------------------------ [2003-10-04 09:42:46] jeroen at zwolnet dot com Description: ------------ See code and workaround (explains it all :) 1. (this might be by design): it looks like vars are not allowed to start with a underscore. So eg. 'p._child' in exampple is not allowed. 2. (more serious): using a var in the parameterlist seems to loose the last character. In the workaround adding a 'x' after the var name 'p1' generates the correct code. Reproduce code: --------------- Template source: DOES NOT WORK:
        {foreach:p._child,n1,p1}
          ...
          <a href="{t.url(p1)}">{p1.title}</a>
WORKAROUND:
        {foreach:p.treeChild,n1,p1}
          ...
          <a href="{t.url(p1x)}">{p1.title}</a>
------------------------------------------------------------------------
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.dev (#22383) next »