I'm trying to detect which controller I'm using or what controller I'm on and then change my menu accordingly to the page I'm on.
( Make a selection in the menu so the user can see were he is on the page! )
I really don'开发者_StackOverflow中文版t know what to write to check what it's using...
<? if($this->url(array("controller" => "index", "action" => "index"), null, true)) {
    echo("LOL");
}
?>
I tried that but that stuff didn't work at all, I know it's the wrong thing to use, so please help me =D
You can get Controller and Action name from the current Request object with getControllerName() and getActionName().
From your controller:
$controller = $this->getRequest()->getControllerName();
$action = $this->getRequest()->getActionName();
// set to View
From a ViewHelper
$front = Zend_Controller_Front::getInstance();
$controller = $front->getRequest()->getControllerName();
$action = $front->getRequest()->getActionName();
// do something with it
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论