Answer the question
In order to leave comments, you need to log in
Is it possible to start writing a class separately from yii2, and then insert it into yii2 and make it work right away?
Heard about entities in OOP, and every class is an entity. Here I want to make a class (entity) for registration, statistics on the site. It will be 2 classes. Can I make them separately (in another project in a separate file), and then paste them into yii2 and make them work right away?
I want it to be such as if they blew which you just copy into the project (these 2 files) and everything works the same there.
Answer the question
In order to leave comments, you need to log in
You can, but setting it to "2 clicks" will not work, most likely you will have to write a separate interaction interface for the framework. In any case, the idea is stupid and the game is not worth the candle.
Each framework has its own way of working with the database, Yii has ActiveRecord. So no, you can't. You will have to rewrite the code for a specific framework.
Here I want to make a class (entity) for registration, statistics on the site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question