In my zend layout.phtml I am serving my navigation like this:
<?php
$userInfo = new Zend_Session_Namespace('userInfo');
if($userInfo->userType=='admin')
{
echo '<li ><a href="/adminhome">home</a></li>';
echo '<li ><a href="addbook">Addbooks</a></li>';
echo '<li class="selected"><a href="about.html">EditBook</a></li>';
echo '<li><a href="logout">Adduser</a></li>';
echo '<li><a href="logout">Logout</a></li>';
}
?>
in a normal page I can get url this way
$this->view->assign('url',$this->getRequest()->getRequestUri());
$url = $this->getRequest()->getRequestUri();
$b=basename($url);
$this->view->assign('b',$b);
I want this url in my layout.phtm how can I pass this from bootstrap.php to layout.phtml? here my requirement is to add a class to li like this:
<li <?php if($b==EditBook) echo 'class="selected' ?> "><a href="about.html">EditBook</a></li>
Better way to obtain it, is to write a view helper that will assign necessary variables
and init it in your Bootstrap