backend/controllers/MediaCommentController.php
/**
     * Lists all MediaComment models.
     * If there is media, the action will generate list of all MediaComment models based on Media ID.
     *
     * @param null|integer $media Media ID
     * @return mixed
     */
Lists all MediaComment models.
If there is media, the action will generate list of all MediaComment models based on Media ID.

@param null|integer $media Media ID
@return mixed
Lists all MediaComment models . If there is media the action will generate list of all MediaComment models based on Media ID . @param null|integer $media Media ID @return mixed
public function actionIndex($media = null)
    {
        $mediaId = null;
        if ($media) {
            $media = $this->findMedia($media);
            $mediaId = $media->id;
        }
        $searchModel = new MediaCommentSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $mediaId);
        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'media' => $media,
        ]);
    }
public function actionIndex ( $ media = null ) { $ mediaId = null ; if ( $ media ) { $ media = $ this -> findMedia ( $ media ) ; $ mediaId = $ media -> id ; } $ searchModel = new MediaCommentSearch ( ) ; $ dataProvider = $ searchModel -> search ( Yii :: $ app -> request -> queryParams , $ mediaId ) ; return $ this -> render ( 'index' , [ 'searchModel' => $ searchModel , 'dataProvider' => $ dataProvider , 'media' => $ media , ] ) ; }
Lists all MediaComment models.
Lists all MediaComment models .