Re: Re: Formbuilder: Date

From: Date: Thu, 26 Aug 2004 22:22:58 +0000
Subject: Re: Re: Formbuilder: Date
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14320@lists.php.net to get a copy of this message
It's all right here: http://opensource.21st.de/tiki-index.php?page=Configuring+Formbuilder ;-) You can configure *any* option through the DataObject, including this one. Just ass this to the DataObject which needs the different callback: var $fb_dateToDatabaseCallback = 'someFunction'; You could also set this in preGenerateForm() if you want to use something like array(&$this, 'someFunc'). On Thu, 26 Aug 2004 15:36:24 -0500, Sarah Gray <sarah@fabled.net> wrote: > Is there a way to use the dateToDatabaseCallback function in individual > forms (overriding the global setting)? > ie, $fg->dateToDatabaseCallback = 'dateToDB'; where a specific page needs > one display format different from the global > setting for the site? If so how would you set the syntax? > > Thanks, s. > > Markus Wolff wrote: > > > Tobias Nix wrote: > > > > >> Do i have to set a specific format in the db for > > >> the date field? > > > > > > has to be date or datetime. > > > > If the dateFields property is used (as described), other field types can > > be used as well. You'll just have to define the proper callback > > functions for date format conversion in your .ini file: > > > > [DB_DataObject_FormBuilder] > > dateToDatabaseCallback = dateToDB > > dateFromDatabaseCallback = dateFromDB > > > > The above setting will call the (global) function dateToDB() whenever a > > date is to be converted from the user input format to the storage format > > in the database. dateFromDB() will be called for the opposite task. > > > > CU > > Markus > > > > -- > > PEAR General Mailing List (http://pear.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

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