Yii::createComponent([ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=mydatabase', 'username' => 'root', 'password' => '', 'charset' => 'utf8mb4', ]);
Yii::createComponent([ 'class' => 'yii\caching\FileCache', 'cachePath' => '@runtime/cache', ]);In both examples, the packages being used are part of the Yii core libraries. Yii provides many other packages and libraries that can be used with createComponent to create custom components tailored to the needs of the application.