wiki | forum | trac | otrs | joomla | tech blog | mailman | bewelcome Branches: test.bw | alpha.bw | www.bw Participate: download | get involved

Ticket #459 (closed new feature: fixed)

Opened 8 months ago

Last modified 5 months ago

RoxGenericPage - $Page object in controllers

Reported by: lemon-head Assigned to: lemon-head
Priority: major Milestone: Rox Framework
Component: FrameWork Version:
Keywords: Cc:
Follow up needed: none Frequently reported: 1
Announce on BW: 0

Description

With the class RoxGenericPage?, the $Page object in our controllers will no longer be a global variable, but a local one, and rendering will happen inside the controller. This way we reduce dependencies on global state, and make our applications more independent.

This is a hybrid solution between the #436 RoxPageView scheme and the old MyTB scheme, and is more or less compatible with both.

$Page object in old MyTB scheme

The page object was obtained as a global object by

$Page = PVars::getObj('page');

Then the controller set attributes of that object:

$Page->teaser = 'this is the teaser';

Finally, in page.php, these global variables are inserted in the page html.

$page object in RoxGenericPage? scheme

The page object is created as a local object by

$page = new RoxGenericPage();

Then the controller set attributes of that object:

$page->teaser = 'this is the teaser';

Finally, in the controller, the render() function is called on that local object.

$page->render();

For now, the $page->render() will do nothing but call the page.php template. Maybe it will do this another way later. Anyway, the applications don't have to care about how the $page object does the rendering.

Change History

03/11/08 22:15:31 changed by lemon-head

  • follow_up changed from none to review code.
  • owner set to lemon-head.
  • status changed from new to assigned.

[4338] - RoxGenericPage? is online.

04/11/08 01:29:53 changed by lemon-head

This class is now called "PageWithParameterizedRoxLayout?". Which describes exactly what it is :)

(the parameters being injected by "$page->title = ..." etc.

04/21/08 22:02:02 changed by lemon-head

  • milestone changed from unassigned to Rox Framework.

06/14/08 19:27:46 changed by lemon-head

  • follow_up changed from review code to none.
  • status changed from assigned to closed.
  • resolution set to fixed.
Trac Customization: trac stylesheet
SourceForge.net Logo