Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

generated base controller wrong namespace in findModel #147

Open
@daronjay

Description

@daronjay

Hi, I have looked online and in the docs, cant see this issue. When I generate with ./yii gii/api --openApiPath=http://localhost:3000/documentation/json

My base classes all have a broken findModel method. I am getting

public function findModel($id)
{
        $model =  \::findOne($id); 
        
        if ($model !== null) {   
        
            return $model;  
            
        }       
        
        throw new \yii\web\NotFoundHttpException("Object not found: $id");      
  }

where I would be expecting say \common\models\Company::findOne($id).

I assume some config isn't set right, but I'm blowed if i can see how.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions