In my yii app, i get a date string via ajax get then i try to pass it to my feature widget. The thing is that sometimes i get the date via GET
url and sometimes i use a default
one that i get directly in the widget (so in that case no variable needs to be passed). Here is the code:
controller:
public function actionGetDate($date) {
$this->render('index',array('date' =>$date));
}
The $date
passes to the view without any problem.
My view:
if (isset($date))
{
echo "$date !!!!";
$this->widget('FullWidget',array('date2' =>$date) );
} else {
echo "not date";
$this->widget('FullWidget');
}
when $date
is not set, then the code runs without any issue.
when $date
is set and then it goes to this line below and it gets me 404 Error…
$this->widget('FullWidget',array('date2' =>$date) );
here is 404 error:
"Error 404"
nothing more then that.
FullWidget:
<?php
class FullWidget extends CWidget {
private $_userConfig;
public function init() {
$this->_userConfig = Yii::app()->getModule('module1234')->getDefaultConfig();
}
public function run() {
if (isset($date2))
{
echo "yes!!!";
//$this->render('small_Widget', array('config' => $this->_userConfig,'date' => $date2));// this line is commented and i dont run it yet. the problem is when i'm trying to pass the variable from the view to the FullWidget
}else{
echo "no!!!!";
$this->render('small_Widget', array('config' => $this->_userConfig));
}
}
}
Does anybody knows whats the problem?
Thanks!!