<?php if ( $this->controller->Session->check('AuthenticatedProfile') )
$this->renderElement('admin_menu'); ?>
I usually write it as a one liner, but it wraps in my email client.
On 9/11/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
Hi.
I am currently trying to reuse my views for both admin and public
access. If a user is logged in there will be displayed edit, delete,
modify etc. bottoms. There won't be ACL control because only 1-2 users
will maintain my site. This is how I have done this in the view:
example: If a user is logged in - display add bottom:
<?php if (!empty($_SESSION['User']['username'])): ?>
<?php echo $html->link('New Ccase', '/ccases/add'); ?>
<?php endif; ?>
This is nice and works well - is it possible to create some sort of
alias/constant so that I can write this instead:
<admin>
<?php echo $html->link('New Ccase', '/ccases/add'); ?>
</admin>
Best regards.
Asbjørn Morell.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
- Re: pretty code. John Zimmerman
- Re: pretty code. jitka
- Re: pretty code. lloydhome
- Re: pretty code. jitka
