/**
  * Finds the Category model based on its path.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $path
  * @throws \yii\web\NotFoundHttpException
  * @return Category the loaded model
  */
 protected function findModel($path)
 {
     if (($model = Category::findByPath($path)->active()->one()) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }