i want create some component, for example
class Geo extends CWidget
{
public $text;
public function run()
{
if (Yii::app()->request->isPostRequest)
{
$this->text = Yii::app()->request->getPost('text');
}
$this->render('geo', array(
'text'=>$this->text,
));
}
}
//view
<input type="text" id="text" name="text" value="<?php echo $text; ?>" />
now i want to put this component inside controller
this is view controller
echo CHtml::beginForm();
$this->widget('Geo');
echo CHtml::submitButton('OK');
echo CHtml::endForm();
so how can i access of new value of property text in controller?
$geo=new Geo;
if (Yii::app()->request->isPostRequest)
$geo = $_POST['Geo'];// don't work
echo $geo->text;