dimis283
(Dimis283)
October 16, 2009, 7:19am
1
I have this code at my mainmenu view of BackMenu CWidget.
<?php $a=Yii::app()->user->name; echo CHtml::link("$a",$profileurl['user']) ;?>
At xampp-windows vista it works ok but at debian/apache there is the error Undefined index: user
Also I see thet the link is there were I am not at debug mode.
This view use also and the main menu CWidget(with other menu) but it is ok.
What is wrong?
mbi
(mbi)
October 16, 2009, 7:29am
2
check your error_reporting on your windows
What does
<?php var_dump($profileurl);
?
mikl
(Mike)
October 16, 2009, 9:37am
3
I have this code at my mainmenu view of BackMenu CWidget.
<?php $a=Yii::app()->user->name; echo CHtml::link("$a",$profileurl['user']) ;?>
At xampp-windows vista it works ok but at debian/apache there is the error Undefined index: user
That’s the same like in your ather topic: It’s due to php’s error reporting set to E_STRICT. That means, you should check if a key exists in an array before reading it. It’s good practice to always do so.
if (isset($profileurl['user'])) ...