My navigation is in the header of the default layout. I want to redirect the special div () to the home page from the navigation button I'm trying to set up one I have this, which does not work:
& lt; Li & gt; & Lt ;? Php echo $ this- & gt; HTML-> Link ('id' = 'gtc:' 'about_page'), array ('ABOUT', array ('Controller' = & gt; 'page', 'action' =>, 'display', 'home'), array ('Escape' => FALSE); ? & Gt; & Lt; / Li & gt;
This page controller takes arguments and redirects on some pages. It looks like:
Public function display () {$ path = func_get_args (); $ Page = $ path [0]; $ Count = count ($ path); If (! $ Count) {return $ this-> Redirect ('/'); } $ Page = $ subpage = $ title_for_layout = null; If (! Empty ($ path [0])) {$ page = $ path [0]; } If (! Empty ($ path [1])) {$ subpage = $ path [1]; } If (! Empty ($ path [$ count - 1])) {$ title_for_layout = Inflector :: humanize ($ path [$ count - 1]); } $ This- & gt; Set (compact ('page', 'subpage', 'title_for_ layout')); {$ This-> Try rendering (implode ('/', $ path)); } Hold (MissingviewExpress $ E) {If (Configure :: Read ('Debug')) {$ $ e; } New NotFoundException Throw (); }}
Can someone help me? Can it be easier to redirect with a render or redirect method?
If I think that you have to correct only one thing
< Code> & lt; Li & gt; F- & Gt; 'About_page'), array ('escape' => FALSE)); ? & Gt; & Lt; / Li & gt;
You do not need to add '#' and ID to your array.
Edit
& lt; Li & gt; F- & Gt; 'About_page', 'escape' = & gt; FALSE); ? & Gt; & Lt; / Li & gt;
The fourth parameter is a corroborated message and this is not the escape option I wrote above.
Comments
Post a Comment