From: Bob D. <bd...@si...> - 2005-05-13 20:00:04
|
Hey dude, > That would be fantastic. > > I'm no authority on the Zend PHP API - luckily calling user functions > appears to be documented here: > > http://www.php.net/manual/en/zend.calling-user-functions.php I got a present for ya You can now do something like this: $rlib = rlib_init(); rlib_version(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "array.xml"); rlib_add_function($rlib, "bobdoan", "bobdoan", 1); rlib_add_function($rlib, "mikeroth", "mike_roth", 2); rlib_set_output_format_from_text($rlib, "pdf"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib); function mike_roth($a, $b) { return "pancakes are yummier then $a and $b"; } function bobdoan($a) { return strtoupper($a); } And then in the XML do: <field value="bobdoan(mikeroth('bacon', 'eggs'))" width="50"/> http://www.sicom.com/~bdoan/rlib-1.3.4.tar.gz see src/examples/php/array[xml|php] as an example You owe me a crash fix now ;) - Bob |