Re: Formbuilder fieldLabel postfix/prefix [feature request?]

From: Date: Thu, 21 Apr 2005 11:01:58 +0000
Subject: Re: Formbuilder fieldLabel postfix/prefix [feature request?]
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18861@lists.php.net to get a copy of this message
Justin Patrin wrote:
On 4/20/05, Rodrigo Alvarez <papipo@gmail.com> wrote:
Hi PEARs, I'm using this inside a DO: var $fb_linkDisplayFields = array('name', 'price', 'costcategory_id'); var $fb_linkDisplayLevel = 2; I want to append an Euro symbol to the 'price', so It can be easy identified in the select field being generated. Is this possible? I'm trying to do it by using this: function postGenerateForm(&$form, &$fb) {
    $costvariable_id = &$form->getElement('costvariable_id');
    foreach ($costvariable_id->_options as $opt) {
        // Do some kind of replacement here
    }
} Any ideas?
Perhaps a formatting callback? For the full DO string (as returned by DB_DataObject_FormBuilder::getDataObjectString($do)): dataObjectFormatter($doString, &$do) For a DO field: dataObjectFieldFormatter($fieldString, $field, &$do)
I used this inside the DataObject beign used by FormBuilder: function dataObjectFieldFormatter($fieldString, $field, &$do) { if ($field == 'price') { $do->price = $fieldString . ' €/hora'; } } But that method is not called anytime. How should I do it? Where should I implement that method? Thanks.

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