public function actionComponents($id) { // $documnttypeId = Yii::$app->getRequest()->getQueryParam($id); //echo $id; $documentTypeName = Documenttype::find()->where("documenttypeid=" . $id)->one(); //print_r($documentTypeName); $sql = 'SELECT * FROM topic WHERE topicid IN (SELECT topicid FROM documenttypetopic WHERE documenttypeid = ' . $id . ')'; $data = Topic::findBySql($sql)->all(); // print_r($data); exit; return $this->render('components', array('topic' => $data, 'documentTypeName' => $documentTypeName)); }