Generating page output for your pages
Hi all, How do you generally accumulate the output for the various pages in your module functions that have to return some HTML? I have been directly printing all my desired output and using the php output buffer functions to get the page's output. I haven't seen many other authors do this. May be I am doing something wrong, what is the generally followed method for this? Raj
I normally use theming to return HTML. If using a function, the HTML accumulates in a variable named $output or $content. If using a PHP template, I use the print function within the template. On Sep 13, 2009, at 7:34 AM, rajasekharan wrote:
Hi all,
How do you generally accumulate the output for the various pages in your module functions that have to return some HTML? I have been directly printing all my desired output and using the php output buffer functions to get the page's output. I haven't seen many other authors do this. May be I am doing something wrong, what is the generally followed method for this?
Raj
If I understand what you are asking correctly, the best practice in your module functions would be to call theme('x_y') where 'x' is your module name and 'y' is something descriptive (likely the same name as your function which is invoking it). Then implement a theme_x_y() function which generates the output in a variable like $output and then returns $output. On Sat, Sep 12, 2009 at 7:34 PM, rajasekharan <websweetweb@gmail.com> wrote:
Hi all,
How do you generally accumulate the output for the various pages in your module functions that have to return some HTML? I have been directly printing all my desired output and using the php output buffer functions to get the page's output. I haven't seen many other authors do this. May be I am doing something wrong, what is the generally followed method for this?
Raj
participants (3)
-
Darren Oh -
rajasekharan -
William Smith