Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:23:24+00:00 2026-06-08T05:23:24+00:00

layout.phtml: <?php echo $this->doctype() ?> <html> <head> <?php echo $this->headTitle().\n; ?> <?php echo $this->headLink()

  • 0

layout.phtml:

<?php echo $this->doctype() ?>
<html>
<head>
    <?php echo $this->headTitle()."\n"; ?>
    <?php echo $this->headLink() ."\n"; ?>    
    <?php echo $this->headScript(); ?>
</head>
<body>
<div id="wrap">

       <div class="header">
            <div class="logo"><a href="index.html"><img src="../../images/logo.gif" alt="" title="" border="0" /></a></div>            
        <div id="menu">
            <ul>                                                                       
            <li class="selected"><a href="index.html">home</a></li>
            <li><a href="about.phtml">about us</a></li>
            <li><a href="category.phtml">books</a></li>
            <li><a href="specials.phtml">specials books</a></li>
            <li><a href="myaccount.phtml">my accout</a></li>
            <li><a href="register.phtml">register</a></li>
            <li><a href="details.phtml">prices</a></li>
            <li><a href="contact.phtml">contact</a></li>
            <li><a href="addbook.phtml">adddbook</a> </li>
            </ul>
        </div>     


       </div> 


       <div class="center_content">
        <div class="left_content">
       <?php echo $this->layout()->content ?>

I am new to zend framework here i am facing problem with displaying navigations. in pure php i can serve my navigation by checking sessions. like this:

<?php 
if($_SESSION['usertype']=='admin')
{
echo "<li><a href="addbook.phtml">adddbook</a> </li>";
}

?>

My question is how can i implement this in zend framework. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:23:26+00:00Added an answer on June 8, 2026 at 5:23 am

    You can do this in a myriad of ways like the Zend_Auth, but the closes to the $_SESSION method is using Zend_Session.

    First you need to start Zend_Session before any output is sent to the browser, just like a normal php session. I do it in my index.php right after setting all my paths and autoloaders.

    Zend_Session::start();
    

    Next step is creating a namespace for the userinformation and adding the relevant information to it, preferably when you authenticate the user.

    $userInfo = new Zend_Session_Namespace('userInfo');
    $userInfo->userType = 'admin';
    

    This is the equivalent to setting a $_SESSION[‘userInfo’][‘userType’] = ‘admin’;

    Last, get the information in your layout:

    <?php 
    $userInfo = new Zend_Session_Namespace('userInfo');
    if($userInfo->userType=='admin')
    {
        echo "<li><a href="addbook.phtml">addbook</a> </li>";
    }
    ?>
    

    Read this link for more information http://framework.zend.com/manual/en/zend.session.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I initialize my placeholder like so: default.phtml (layout file) <?php $this->placeholder('hero')->captureStart(); ?> <div class=primary>
In my layout.phtml file I have : <?php echo $this->Test(); ?> I have created
In my zend layout.phtml I am serving my navigation like this: <?php $userInfo =
In my Zend Framework app, I have following code: index.php $app_started_time = time(); layout.phtml
I got my headTitle up running, except i cannot echo it in my layout
the directory structure I'm trying to achieve would be this: application/default/views/layouts/layout.phtml application/default/views/scripts/index/index.phtml application/admin/views/layouts/layout.phtml application/admin/views/scripts/index/index.phtml
I have this code that I want to insert a div clear class the
In layout xml file, I set properties using @string like this: <com.hardpass.MyCustomComponent android:layout_width=fill_parent android:layout_height=wrap_content
My Layout structure is like this <LinearLayout> <scrollview> <RelativeLayout> <scrollview> ... ... </scrollview> </RelativeLayout>
This layout is a shelf with 3 books each row. I current come up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.