On Mon, Oct 12, 2009 at 11:55 PM, Hector Virgen <[email protected]> wrote:

> Another way around this would be to set your default description early
> (like in a bootstrap init method) and let your view scripts override it
> when necessary.
>
>
Let your view scripts override it when necessary -- that's exactly what I am
not figuring out how to do.

My scenario is slightly different, but typical. I want my layout to detect
if there's a logged in user; if so, display "Welcome User Foo" , otherwise
display a link to the login page. No problem.

If, however, the current page itself is the login page, I want to suppress
the welcome/log in message entirely. Thus, in my layout,

$this->placeholder('loginBox')->captureStart();?>
<div id="loginDiv">
<?php if ($this->user) :?>Welcome <?=$this->user->firstname?>
<?php else:?>
<a href="/users/login/" ></a>[log in]</a>
<?php endif;?>
</div>
<?php $this->placeholder('loginBox')->captureEnd();

and later in the layout script,

<?= $this->placeholder('loginBox')?>

Once I get into login.phtml, I can't seem to reset the content of the
placeholder to empty string, or unset it, or otherwise prevent it from being
displayed, having tried exchangeArray() and various other tricks. It seems
it's already been output to the browser and that's that. What am I missing?

Thanks a million,

-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness

Reply via email to