/** * * @return string * @throws \Exception */ public function actionInstall() { $composer = $this->getComposer(); $cmd = new RequireCommand(); $input = new ArrayInput(['packages' => ['rmrevin/yii2-fontawesome']]); $output = new BufferedOutput(); $app = new Application(); $io = new BufferIO(); $composer->getConfig()->getRepositories(); $cmd->setComposer($composer); $cmd->setApplication($app); $cmd->setIO($io); $result = ''; if ($cmd->run($input, $output)) { $result = $output->fetch(); } return $this->render('install', ['result' => $result]); }