Re: [SMARTY] Filemaker with Smarty

From: Date: Mon, 15 Dec 2003 20:37:41 +0000
Subject: Re: [SMARTY] Filemaker with Smarty
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10694@lists.php.net to get a copy of this message
Thanks for your swift feedback jason. I appreciate your effort to help me clarify my request. Sorry if you misunderstood my query. I realize it may seem at first blush to refer to a general PHP question. Let me rephrase it... As I understand it, Smarty gains purview on template variables when they are set using the assign() method. There are many ways to prepare data in a PHP file so that smarty can "see" it in the template file. Data that comes from a database backend is often massaged in ways that are specifically tuned to work with smarty in the most efficient way. Each special smarty tag has its own requirements. eg. the {html_table} tag wants a simple array and a variable with the number of cols you want in the table. Therefore, I am looking for anyone who is also working with getting data from FMPro *tuned to work best* with smarty and its multifarious tags. PHP coders would say to me "This is more of a smarty question. Wrong mailing list." Jason, you must now see that smarty-general is the proper list to pose this question because I am really asking about fine-tuning data arrays for proper use in smarty. In fact, a recent thread about the best way to build an array for sub-summary style presentation in smarty section loops addressed such an issue. An example from my experience of what I am alluding to: FMPro-FX.php spits out XML in a multi-array with fieldname as a key and the actual data as value. I want to get these data arrays into Smarty template vars with the *minimum of fuss*. I began by parsing the whole shebang into a half-dozen simple arrays, then passing those arrays to a smarty template for use in the html_table tag. This worked but was inelegant. I shortly discovered the php function array_walk() could be used to get the field names from FMPro to become smarty template vars with this little trick: ------------------------------------ //$first_record_array is the multi-dim data array for one row //make the data available to smarty array_walk ($first_record_array, 'smarty_assign_FX_data_array', &$smarty); $smarty->display('portal_test.tpl'); //walk the multi-dim array returned by FX.php //assign all fieldnames to smarty variables function smarty_assign_FX_data_array ($FXdata, $key, &$smarty) { //smarty doesn't like variables with punct chars $key=str_replace(array(":","."), "", $key); $smarty->assign($key, $FXdata); } ------------------------------------ Essentially, I am looking for people to post ideas like that. Do you have any ideas like that for Smarty-FMPro? Do you have Smarty-FMPro techniques to share? Kind regards, dan On 12/15/03 2:54 PM, "Jason Hubble" <jason@axsystech.net> wrote: > This is more of a php question. Wrong mailing list. > > Daniel Cummings <dan@dbmscan.com> wrote: > >> Hi guys, >> >> Anyone here using Filemaker Pro as a backend database with smarty? >> >> I am making progress, but I want to know if there is anyone out there > using: >> >> FMPro - FX.php (class for wrapping FMPro's XML export) - Smarty >> >> dan > > >

« previous php.smarty.general (#10694) next »