Yii 2 Namespace missing?

I have a namespace missing problem in Yii 2. I installed the advanced application. I am referencing a backend model from my frontend controller. Below is a code snippet of my backend model, frontend controller and error message.

Error


Unable to find 'backend\models\PaymentsMethod\TermsAndConditions' in file: C:\inetpub\wwwroot\jobmanager/backend/models/PaymentsMethod/TermsAndConditions.php. Namespace missing?



Backend Model


namespace app\models\PaymentsMethod;

use Yii;

class TermsAndConditions extends \yii\db\ActiveRecord

{



Frontend Model


 public function actionCreate()

{

    $model = new estimate();

    $tnc =  new \backend\models\PaymentsMethod\TermsAndConditions();

Backend Model should be


namespace backend\models\PaymentsMethod;

Thanks for the response. when I implement the above in my backend I get an Unknown Class error

Does the same happen if you move TermsAndConditions model to backend\models instead of backend\models\PaymentsMethod (and modify namespace)?

I have resolved my problem. I was trying to access a backend model class from a frontend controller. I resolved this by moving the backend model class to the common folder and from there I can reference it from both the backend and frontend.

Thanks ;)