[support] Templating in Drupal 5.1 - the cleanest way to do it?

Cyberswat cyberswat at gmail.com
Tue Apr 10 21:04:27 UTC 2007


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.

On 4/10/07, Larry Garfield <larry at garfieldtech.com> wrote:
>
>
> #################################################
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070410/f21fb00e/attachment.htm 


More information about the support mailing list