Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MyUserClass
- //Menu items constant
- const MENUABOUT='about';
- const MENUSERVICE='service';
- const MENUPROJECT='project';
- const MENUPARTNER='partner';
- const MENUCONTACTS='contacts';
- private $menuitem;
- public function setMenuItem($item){
- $this->menuitem=$item;
- }
- public function getMenuItem(){
- return $this->menuitem;
- }
- //apps/frontend/components/components.class.php
- public function executeMenu() {
- $this->menu = array(
- myUser::MENUABOUT => 'menu1',
- myUser::MENUSERVICE => 'menu2',
- myUser::MENUPROJECT => 'menu3',
- myUser::MENUPARTNER => 'menu4',
- myUser::MENUCONTACTS => 'menu5',
- );
- $menuitem = $this->getUser()->getMenuItem();
- $this->menu[$menuitem] = 'active';
- }
- //menu
- ul class="grid_<?php echo RouteCheck($sf_context->getRouting()->getCurrentRouteName()) ?> menu">
- <li><a href="<?php echo url_for('@localized_homepage') ?>" id="<?php echo $menu[myUser::MENUABOUT] ?>"><?php echo __('Про компанію')?></a></li>
- <li><a href="<?php echo url_for('@services') ?>" id="<?php echo $menu[myUser::MENUSERVICE] ?>"><?php echo __('Послуги')?></a></li>
- <li><a href="<?php echo url_for('@projects') ?>" id="<?php echo $menu[myUser::MENUPROJECT] ?>"><?php echo __('Реалізовані проекти')?></a></li>
- <li><a href="<?php echo url_for('@partners') ?>" id="<?php echo $menu[myUser::MENUPARTNER] ?>"><?php echo __('Партнери')?></a></li>
- <li><a href="<?php echo url_for('@contacts') ?>" id="<?php echo $menu[myUser::MENUCONTACTS] ?>"><?php echo __('Контакти')?></a></li>
- </ul>
- //action of module
- $this->getUser()->setMenuItem(myUser::MENUABOUT);
Advertisement
Add Comment
Please, Sign In to add comment