Answer the question
In order to leave comments, you need to log in
Why is Yii2 not finding classes?
I'm new to yii2 and I'm facing the same problem. BASIC application template
User.php model in the models folder:
namespace app\models;
use Yii;
use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
use yii\web\IdentityInterface;
class User extends ActiveRecord implements IdentityInterface
{
namespace app\models;
use yii\base\Model;
/**
* Signup form
*/
class SignupForm extends Model
{
.................
public function signup()
{
....................
$user = new User();
................
public function actionSignup()
{
$model = new SignupForm();
PHP Fatal Error - yii\base\ErrorException
Class '\common\models\User' not found
Answer the question
In order to leave comments, you need to log in
Case 1
The file is called AppointmentForm.php and the class is Appointment s Form. And they should be named the same
Case 2
Look at the stack trace of the error and look for the place where it occurs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question