Advertisement
manchumahara

Get Joomla menu params in view.html.php

Jul 23rd, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. // Get the menu item object
  2.        
  3. // Get the menu item object
  4.        
  5.         $app                = JFactory::getApplication();        
  6.         $this->params       = '';        
  7.        
  8.         $menus              = $app->getMenu();
  9.         $menu               = $menus->getActive();
  10.         $this->params       = $app->getParams();   
  11. $this->assignRef('mparams', $this->params );
  12.  
  13. //another way
  14. $app                = JFactory::getApplication();
  15.         $menu               = $app->getMenu();
  16.         $activemenu         = ($menu->getActive()) ? $menu->getActive() : $menu->getDefault();
  17.         $mparams = '';
  18.         if (is_object($activemenu)) {
  19.             $mparams = new JParameter($activemenu->params);
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement