The threads probably getting old ... but just in case anyone else is following this, Larry's example is almost perfect. Simply modify
function phptemplate_foo_or_something() {
to
function phptemplate_foo_or_something($data) {
Then everything will work. Thanks for the help David and Larry.
#################################################
module code - mymod.php
#################################################
function mymod_foo() {
$data = array('foo' => 'bar');
return theme('foo_or_something', $data);
}
function theme_foo_or_someting($data) {
return "something you do with $data that generates a string";
}
#################################################
template.php code
#################################################
function phptemplate_foo_or_something() {
return _phptemplate_callback('foo_or_something', $data);
}
#################################################
foo_or_something.tpl.php
#################################################
<h1>I want to output value of $foo here</h1>
(In this case $foo will have a value of 'bar').
Cheers.
--Larry Garfield