chipnin
chipnin

Reputation: 21

How to install yii2 application without database config

Now i want to setup an application yii2 to test link redirect and get response result. So i dont need a database connect to it. How to setup app run without connect to a database. Thanks.

Upvotes: 0

Views: 312

Answers (1)

Andrew
Andrew

Reputation: 1866

Yii modules and components are loaded only when needed. You can simple write your own controller and model, which are not using database. Just don't inherit your model from ActiveRecord, use yii\base\Model. And Yii will not instantiate unnecessary database connection when handling your route, even if database section is presented in config.

Upvotes: 1

Related Questions