public function actionView($id = null, $slug = null)
    {
        $model = User::find()->where(['and',
                ['id' => $id],
                ['!=', 'status', User::STATUS_REGISTERED],
                ['or',
                    ['slug' => $slug],
                    ['slug' => ''],
                    ['slug' => null],
                ]
            ])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Member with this ID.'));
            return $this->redirect(['members/index']);
        }
        return $this->render('view', ['model' => $model]);
    }
public function actionView($id = null, $slug = null)
    {
        $model = User::find()->where(['and',
                ['id' => $id],
                ['!=', 'status', User::STATUS_REGISTERED],
                ['or',
                    ['slug' => $slug],
                    ['slug' => ''],
                    ['slug' => null],
                ]
            ])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Member with this ID.'));
            return $this->redirect(['members/index']);
        }
        return $this->render('view', ['model' => $model]);
    }
public function actionView ( $ id = null , $ slug = null ) { $ model = User :: find ( ) -> where ( [ 'and' , [ 'id' => $ id ] , [ '!=' , 'status' , User :: STATUS_REGISTERED ] , [ 'or' , [ 'slug' => $ slug ] , [ 'slug' => '' ] , [ 'slug' => null ] , ] ] ) -> limit ( 1 ) -> one ( ) ; if ( empty ( $ model ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find Member with this ID.' ) ) ; return $ this -> redirect ( [ 'members/index' ] ) ; } return $ this -> render ( 'view' , [ 'model' => $ model ] ) ; }
Viewing profile of user of given ID and slug.
@param int $id
@param string $slug
@return string|Response
Viewing profile of user of given ID and slug .