[indent]$url = "<some url>";
public function init()
{
[indent]$url = "<some url>";[/indent]
}
function actionSup()
{
[indent]//$url = "<some url>";
Yii::log($url.'sup','info','info');[/indent]
}
// plus some other action methods
[/indent]
}
?>
[/indent]
When I un comment the line initializing url from actionSup it works. But when I try to put it in log with either the first $url or the second it says "Undefined variable : url "
I want to initialize a variable url before doing any ‘action’. I have tried using the above controller but it doesn’t put anything in the log. What is wrong. I don’t want to create any object of this controller class eventually calling the constructor, but I want to avoid the repetition of putting url variable in every action, instead I want a global url variable initialize only when I do some action.