Re: [Phphtmllib-devel] Site Page Cascading with crated objects. How ?
Status: Beta
Brought to you by:
hemna
|
From: walt b. <wab...@3g...> - 2003-12-01 19:45:55
|
mar...@on... wrote:
>(A)
>Observing the phphtmllib site, when I click at Examples menu link, I see two things (modifications) happening :
>
>1) A new content-block is instantiating and replaces the HomePage (that was placed in the same block : content-block);
>
>2) A new "menu" is added to the left-block;
>
>How this was made?
>
>
----Think of the base class (phphtmllibPage) as the 'template' It knows
how to render the layout of the site. So all each specific page of the site
has to do is override 1 method of the base class to get the content that
is specific for that page. It creates a system that helps you focus on
the functionality
that matters most for each page, instead of worrying about layout issues
on each page. You don't care about the layout, you only want to worry
about what that specific page provides as part of the application. That
being said, you can also override other methods of the base
phphtmllibPage class to provide new left
nav content (different menus). So all you have to do is provide new
links in the content that will go to the next script. index.php doesn't
care about what foo.php page does, only that it provides a link to it.
it leaves the content for foo.php up to foo.php. The base class
provides the layout framework.
It's just a different approach to templating, which I believe provides
more long term flexibility then a static template does, but thats
irrelevant.
Walt
>Suppose that I have in (A) momentum (timing, instant) a $page object created/instancied, and it has rendered the page that we are seeing in that instant.
>
>Suppose that "Examples" h-link calls (invoke) a php program called xyz.php, like : <a href=xyz.php>Examples</a>
>
>What kind of code will doing the right modification of content-block of the $page object into the xyz.php program ?
>
>How xyz.php program will see $page object (variable) ?
>
>For a good understanding I am thinking that the site was created in the same way(style) of Example3.php (the using of MyLayoutPage), so...
>
>first_page.php
>...
>$page = new LeftBlockPage("main with menu");
>print $page->render();
>...
>
>xyz.php
>...
>????? ????? ????
>
>
>TIA,
>
>Marcos Nobre
>Brazil
>
>
>
>
>
>Veja o antispam da Netium: http://www.bsb.netium.com.br/servicos/antispam/
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>Does SourceForge.net help you be more productive? Does it
>help you create better code? SHARE THE LOVE, and help us help
>YOU! Click Here: http://sourceforge.net/donate/
>_______________________________________________
>Phphtmllib-devel mailing list
>Php...@li...
>https://lists.sourceforge.net/lists/listinfo/phphtmllib-devel
>
>
|