sanguina
(Bha100710)
1
I was reading this forum post which says why redirecting from the widget is a bad MVC practice but may be good from the DRY point of view.
Forget for the moment, good or bad - the question is how do i actually redirect from a widget ?
This code:
$this->redirect(array('view','site/confirmsubscription'));
yields the error:
thanks for the help 
seenivasan
(Chellamnivas)
2
Dear Friend
It should be
$this->owner->redirect(array('view','site/confirmsubscription'));
What does "site/confirmsubscription" mean?
Regards.
sanguina
(Bha100710)
3
thanks again 
However,
$this->owner->redirect(array('view','site/confirmsubscription'));
is not working…
site/confirmsubscription is the controller/action respectively.
the problem is, this widget is located on several controller induced pages.
So the widget may be accessed from any controller.
seenivasan
(Chellamnivas)
4
Dear Friend
Then the redirect method should be declared in the following way.
$this->owner->redirect(array('site/confirmsubscription'));
or additional Parameters should be appended like below.
$this->owner->redirect(array('site/confirmsubscription','id'=>$this->id));//or $model->id like so.
sanguina
(Bha100710)
5
thanks for replying.
unfortunately that doesnt work 
If i access the widget from a say another page say from user/login,
it redirects to /user/site/confirmsubscription instead of /site/confirmsubscription
resulting in a 404 error 
seenivasan
(Chellamnivas)
6
Dear Friend
I created a widget and put it inside the components folder.
<?php
class RedirectWidget extends CWidget
{
public function run()
{
$this->owner->redirect(array("site/login"));
}
}
?>
At any controller if I call the widget like below, it redirects to login page.
$this->widget('RedirectWidget');
One more suggestion is to put a forward slash at the beginning.
$this->owner->redirect(array('/site/confirmsubscription'));
sanguina
(Bha100710)
7
ha that backslash did the trick 
it is late night or rather wee hours in India…
like me, you too seem to be nocturnal 
thanks once again