yii2-advanced-app

Yii2: how to specify multiples database schemas?

走远了吗. 提交于 2021-02-20 04:51:10
问题 I am using PostgreSQL and the default database schema in my Yii2 application. I created a new schema called laboratory and I need to define it in the common/config/main-local.php file. This is my current main-local.php file: <?php return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'pgsql:host=localhost;dbname=travel', 'username' => 'aaaa', 'password' => 'bbbb', 'charset' => 'utf8', ], ], ]; How can I add the laboratory schema in this file? I need both schemas. Is

How to configure yii2-solr extension

我是研究僧i 提交于 2021-02-07 04:38:36
问题 I want to use yii2-solr extension in one of my projects. How can I configure this extension. Nothing is mentioned on the extension page. Has anyone used this extension? Any help would be appreciable. Thank you. I found the extension on github repo . In readme file it is mention to configure it as follows: 'solr' => [ 'class' => 'sammaye\solr\Client', 'options' => [ 'endpoint' => [ 'solr1' => [ 'host' => '10.208.225.66', 'port' => '8983', 'path' => '/solr' ] ] ] ], But after doing all this I

Error:“Call to undefined method ping.” Using Yii2 and Swiftmailer

耗尽温柔 提交于 2021-01-29 09:53:00
问题 Any help would be highly appreciated. I do not understand what I am doing wrong. I have used Swiftmailer before and it has never been this difficult to configure it. I am using an advanced Yii2 project. This is part of my backend/config/main.php (I have tried with backend/config/main-local.php, common/config/main.php and common/config/main-local.php just in case): .... 'components' => [ 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => false, 'transport' => [ 'class' =>

Yii 2 file input renders hidden file input tag

你离开我真会死。 提交于 2021-01-29 07:15:52
问题 I am using yii2 to build a simple application with a signup feature. Problem is when I render a file input tag using active forms, it render a file input field and a hidden field. The validator then picks the one which is hidden and always says that profile image is required though it saves it in my upload directory and also adds the path to the database but still returns with this error. Thanks for any help. Here is the code: View: <?php $form = ActiveForm::begin(['id' => 'form-signup' ,

Yii2 Advanced installation throws error 'Document root “/var/www/html/project/console/web” does not exist.' while running php Yii serve

一笑奈何 提交于 2020-12-30 08:13:03
问题 I have tried yii2 advanced installation, it works and the pages have been created. But to verify installation I used the command PHP YII serve. it throws the error Document root "/var/www/html/highwaymotels/console/web" does not exist. But when I check the advanced template github it has the same folder as mine. Am I doing anything wrong? else what is the issue here? 回答1: yii serve --docroot="frontend/web/" 回答2: I solve this problem by recreating the config/console.php file than I deleted by

Yii2 Advanced installation throws error 'Document root “/var/www/html/project/console/web” does not exist.' while running php Yii serve

社会主义新天地 提交于 2020-12-30 08:09:47
问题 I have tried yii2 advanced installation, it works and the pages have been created. But to verify installation I used the command PHP YII serve. it throws the error Document root "/var/www/html/highwaymotels/console/web" does not exist. But when I check the advanced template github it has the same folder as mine. Am I doing anything wrong? else what is the issue here? 回答1: yii serve --docroot="frontend/web/" 回答2: I solve this problem by recreating the config/console.php file than I deleted by

Yii2 Advanced installation throws error 'Document root “/var/www/html/project/console/web” does not exist.' while running php Yii serve

核能气质少年 提交于 2020-12-30 08:05:48
问题 I have tried yii2 advanced installation, it works and the pages have been created. But to verify installation I used the command PHP YII serve. it throws the error Document root "/var/www/html/highwaymotels/console/web" does not exist. But when I check the advanced template github it has the same folder as mine. Am I doing anything wrong? else what is the issue here? 回答1: yii serve --docroot="frontend/web/" 回答2: I solve this problem by recreating the config/console.php file than I deleted by

Yii2 Advanced installation throws error 'Document root “/var/www/html/project/console/web” does not exist.' while running php Yii serve

梦想与她 提交于 2020-12-30 08:04:45
问题 I have tried yii2 advanced installation, it works and the pages have been created. But to verify installation I used the command PHP YII serve. it throws the error Document root "/var/www/html/highwaymotels/console/web" does not exist. But when I check the advanced template github it has the same folder as mine. Am I doing anything wrong? else what is the issue here? 回答1: yii serve --docroot="frontend/web/" 回答2: I solve this problem by recreating the config/console.php file than I deleted by

Call to undefined function Mpdf\mb_regex_encoding()

强颜欢笑 提交于 2020-12-29 19:47:59
问题 i want to make some reports with yii2 Mpdf but when i running the program i got an error like Call to undefined function Mpdf\mb_regex_encoding() please tell me how to solved this program this is my controller public function actionRpt($id) { $content = $this->renderPartial('rpt', [ 'model' => $this->findModel($id), ]); // setup kartik\mpdf\Pdf component $pdf = new Pdf([ // set to use core fonts only 'mode' => Pdf::MODE_UTF8, // A4 paper format 'format' => Pdf::FORMAT_A4, // portrait

Call to undefined function Mpdf\mb_regex_encoding()

烂漫一生 提交于 2020-12-29 19:47:37
问题 i want to make some reports with yii2 Mpdf but when i running the program i got an error like Call to undefined function Mpdf\mb_regex_encoding() please tell me how to solved this program this is my controller public function actionRpt($id) { $content = $this->renderPartial('rpt', [ 'model' => $this->findModel($id), ]); // setup kartik\mpdf\Pdf component $pdf = new Pdf([ // set to use core fonts only 'mode' => Pdf::MODE_UTF8, // A4 paper format 'format' => Pdf::FORMAT_A4, // portrait