Jump to content
Larry Ullman's Book Forums

Getparam()


nkhanna24
 Share

Recommended Posts

Hi

I am new in yii framework. I came across this code. 


$criteria=new CDbCriteria();

if(isset($_GET['tag']))
$criteria->addSearchCondition('question.tags',$_GET['tag']);

$param = Yii::app()->request->getParam('param');
$dataProvider=new CActiveDataProvider(Question::model()->recent()->with('user')->with('answers'));

$this->render('index',array('dataProvider'=>$dataProvider,
'param'=>$param,
'tags'=>$tags,
'usertype'=>$usertype));



can anyone explain what getparam('param') and $this->render() do?

 

and where this  'param'  variable coming from ?
thanks in advance...

 

Link to comment
Share on other sites

getParam() retrieves the value of a variable passed to the page (e.g., in the URL).

 

$this->render() is how output is rendered using view files. That's one of the most basic and important things to understand when using Yii.

Link to comment
Share on other sites

 Share

×
×
  • Create New...