On Wed, Dec 03, 2003 at 11:42:09AM -0000, [EMAIL PROTECTED] wrote:
:  
: I have a php page class that i use as a template for my website. Every
: page in my website creates an instance of the class and passes values
: like title and meta tag keywords. The class includes the layout from
: different files e.g. title.lay contains the title and logo.
:  
: In the top right hand corner of my page i have a login status, which
: displays if the user is logged in or not. This is included as
: loginstatus.lay by the class.
:  
: If the page performs a php scripting function, it is included in the
: main content area. This main content area comes after the
: loginstatus.lay, so is evaluated afterwards.

While this answer functioned, it was obviously fundamentally flawed...

: My problem is when creating a logout page. The loginstatus is
: displayed as logged in, but the main content area logouts out the
: user.

At last, the fundamental flaw is ultimately expressed.  :-)

: The reason i designed the class and page layout like this is because i
: wanted to seperate the design and code as much as possible. As a
: temporary solution i have added some code to loginstatus.lay, but this
: is edging towards including code in the layout files which i dont
: want.

MVC-ish patterns are good.  The problem you've encountered is that code
in your main content area may do something that changes the output of
entire page (or in your case the top portion of the page).  You need to
modify your app to first evaluate all code, let it reach its next state,
and *then* generate the correct templated output based on the new state.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to