modules/api/v1/controllers/ProductCategoryController.php
/**
     * Displays a single ProductCategory model.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Displays a single ProductCategory model.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Displays a single ProductCategory model . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionView($id)
    {
        $model = ProductCategory::findOne($id);
        if (!$model instanceof ProductCategory) {
            throw new NotFoundHttpException('Product category doesn\'t exist.');
        }
        if (!empty($model) && !empty($model->image) && file_exists(Yii::getAlias('@productCategoryImageThumbRelativePath') . '/' . $model->image)) {
            $model->image = Yii::$app->request->getHostInfo() . Yii::getAlias('@productCategoryImageThumbAbsolutePath') . '/' . $model->image;
        } else {
            $model->image = Yii::$app->request->getHostInfo() . Yii::getAlias('@uploadsAbsolutePath') . '/no-image.jpg';
        }
        return $model;
    }
public function actionView ( $ id ) { $ model = ProductCategory :: findOne ( $ id ) ; if ( ! $ model instanceof ProductCategory ) { throw new NotFoundHttpException ( 'Product category doesn\'t exist.' ) ; } if ( ! empty ( $ model ) && ! empty ( $ model -> image ) && file_exists ( Yii :: getAlias ( '@productCategoryImageThumbRelativePath' ) . '/' . $ model -> image ) ) { $ model -> image = Yii :: $ app -> request -> getHostInfo ( ) . Yii :: getAlias ( '@productCategoryImageThumbAbsolutePath' ) . '/' . $ model -> image ; } else { $ model -> image = Yii :: $ app -> request -> getHostInfo ( ) . Yii :: getAlias ( '@uploadsAbsolutePath' ) . '/no-image.jpg' ; } return $ model ; }
Displays a single ProductCategory model.
Displays a single ProductCategory model .