Yii Framework Forum: mbmenu - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

mbmenu Rate Topic: -----

#1 User is offline   sravani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 22-January 11

Posted 26 February 2011 - 04:03 AM

can we pass a session variable in mbmenu array??

 <?php $this->widget('application.extensions.mbmenu.MbMenu',array( 
			'items'=>array(
				array('label'=>'Home', 'url'=>array('/home')),
                array('label'=>'School', 'url'=>array('/school'),
				'items'=>array( 										 
					array('label'=>'Edit School Details'),
.........


this is my menu with dropdown list..in this i want a session variable to be pased as url
0

#2 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 26 February 2011 - 04:09 AM

DId you try what I said ?
Should work

'items'=>array(
                array('label'=>'Home', 'url'=>array('/home',array('session_id'=>$_SESSION['id']))),

//or
'items'=>array(
                array('label'=>'Home', 'url'=>$_SESSION['url']), 

--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#3 User is offline   sravani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 22-January 11

Posted 26 February 2011 - 04:18 AM

View PostGustavo, on 26 February 2011 - 04:09 AM, said:

DId you try what I said ?
Should work

'items'=>array(
                array('label'=>'Home', 'url'=>array('/home',array('session_id'=>$_SESSION['id']))),

//or
'items'=>array(
                array('label'=>'Home', 'url'=>$_SESSION['url']), 


hehe hi again...
what i need to ba pase in url is like myproject/index.php/school/EditSchool/1

but i got it as
a/index.php/school/EditSchool?0[id]=1
0

#4 User is offline   sravani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 22-January 11

Posted 26 February 2011 - 04:20 AM

i used your code as
array('label'=>'Edit School Details','url'=>array('/school/EditSchool',array('id'=>Yii::app()->user->schoolId))),

0

#5 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 26 February 2011 - 04:52 AM

how is your url rules ?
should contain
'urlFormat'=>'path',
to be like you said
also
print_r(Yii::app()->user->schoolId);

and check what it contains, looks like it contains an array
--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#6 User is offline   sravani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 22-January 11

Posted 26 February 2011 - 05:04 AM

Yes u r rit gustavo,it is being passed as array..what i did is i just removed the array thats it...

Now it Works...!!!! :D
0

#7 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 26 February 2011 - 05:08 AM

Glad I could help Srav

--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#8 User is offline   sravani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 22-January 11

Posted 26 February 2011 - 05:33 AM

View PostGustavo, on 26 February 2011 - 05:08 AM, said:

Glad I could help Srav

hey, its working fine with firefox browser but session id is not being passed in other browsers like chrome..what can be done?
0

#9 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 26 February 2011 - 05:43 AM

be sure that you have cookie enabled in this browser and you have logged in ...
then
print_r($_SESSION)
to see what it contains
--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users