Ticket #171 (closed enhancement: fixed)

Opened 9 months ago

Last modified 9 months ago

templates_page_output

Reported by: rho Assigned to: rho
Priority: normal Milestone: 0.9
Component: core Version: 0.8.1
Severity: minor Keywords: templates, page, output
Cc: misja, dramirez, ewout, timh Patch Included:
Review Stage:

Description

As i see on elgg, most pages have these lines at end:

$title = 'some title'; $body = run('some:function');

$body = templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => $body));

echo templates_page_draw(array($title, $body));

// exit();

This patch adds a new function templates_page_output() that replaces last templates_draw and templates_page_draw, also adds a end hook.

The end hook i'd use, for example, on a gzip compression plugin. On _init i enable gzip output, and on _end i add the content-lenght header of the output.

Attachments

021_templates_page_output.diff (4.5 kB) - added by rho on 11/21/07 23:37:47.

Change History

11/21/07 23:37:47 changed by rho

  • attachment 021_templates_page_output.diff added.

11/22/07 05:00:16 changed by dramirez

I like this patch, I would make easier (and clever) the way the pages are generated. About the patch I will add move the action() function definition from the generic_comments plugin to elgglib.php how it is suggested on the comments.

11/22/07 11:29:25 changed by misja

I agree, it looks clever and much more efficient. If it doesn't break anything this could go in 0.9.

11/22/07 17:22:16 changed by rho

  • status changed from new to closed.
  • resolution set to fixed.