- Where Developers Learn, Share, & Build Careers


In my zend layout.phtml I am doing my navigation service like this:

  & Lt; ? Php $ userInfo = new Zend_Session_Namespace ('userInfo'); If ($ userInfo-> userType == 'admin') {echo '& lt; Li & gt; & Lt; A href = "/ adminhome" & gt; Home & lt; / A & gt; & Lt; / Li & gt; '; Echo '& lt; Li & gt; & Lt; A href = "adbook" & gt; Addbooks & lt; / A & gt; & Lt; / Li & gt; '; Echo '& lt; Li class = "selected" & gt; & Lt; A href = "about.html" & gt; Adapter book & lt; / A & gt; & Lt; / Li & gt; '; Look & lt; Li & gt; & Lt; A href = "logout" & gt; Adder & lt; / A & gt; & Lt; / Li & gt; '; Look & lt; Li & gt; & Lt; A href = "logout" & gt; Logout & lt; / A & gt; & Lt; / Li & gt; '; }? & Gt;   

In a normal page, I can get the URL like this

  $ this-> View- & gt; Assign ('url', $ this-> gt; getRequest () - & gt; getRequestUri ()); $ Url = $ this- & gt; GetRequest () - & gt; GetRequestUri (); $ B = basename ($ url); $ This- & gt; View-> Allocated ('B', $ B);   

I want this URL in my layout. FTP, how can I pass it from bootstrap.php to layout.phtml? Here I need to add the class to be taken as such:

     

The best way to obtain this, is to write a visual assistant that will assign the required variable

  class help_params Zend_Controller_Action_Helper_Abstract {$ View = $ this-> gtActionController () -> View; $ request = $ this-> getRequest (); $ view-> request URI = $ request-> getRequestUri ();}   

and take it to your bootstrap

  public function_initHelper () {Zend_Controller_Action_HelperBroker :: addHelper (New Helper_ Params ());}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -