Questions tagged [yii]

Use for questions about any version of Yii, an open-source MVC framework for writing web 2.0 applications in PHP5+

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

How to display foreign key value instead of key in grid view in yii 2?

Very new to yii, my question is similar to this question How to get foreign key value instead of key in grid view with searching and filtering in yii 2? I've also seen this wiki https://www....
Raymond's user avatar
  • 1,158
0 votes
0 answers
45 views

Yii2: Create a custom column to filter records based on a condition

I have a table of sales lines which include promo, service, and item columns among others. These 3 columns contain IDs from other tables. A sales line can only have a value for one of these fields e.g....
luigi lopez's user avatar
0 votes
0 answers
26 views

How to add admin user after installing yii advanced first time?

New to yii. I just installed yii-2 advanced it is all setup but I don't see any admin user's details? When I checked database table, I find no users at all. Wasn't this suppose to create admin user by ...
Raymond's user avatar
  • 1,158
0 votes
0 answers
18 views

Weird behavior of Color Input palette - Krajee Yii extension

Description of the Issue: I'm facing an issue with the Spectrum Color Picker in my Yii2 project, specifically when it's used on medium-sized screens (e.g., laptops). When I resize the window, an empty ...
Abdelilah Dahdahi's user avatar
0 votes
0 answers
36 views

Problem Copying Uploaded Files to a New Yii2 Model

I'm working on a Yii2 application and have encountered an issue when attempting to duplicate a model along with its uploaded files. I'm using Yii2's UploadedFile for file uploads. The challenge is ...
Abdelilah Dahdahi's user avatar
0 votes
0 answers
19 views

How to update dropdown form field based on previous field value using Pjax in Yii2?

I'm trying to dynamically update a drop down Active form field based on the value of the previous field in Yii2 framework. The first field represents a project instance and the second field should ...
Abdelilah Dahdahi's user avatar
0 votes
0 answers
26 views

Yii2 how to display image from common folder?

I have a problem with displaying image from common folder. Below are the code: $pic = PicBreed::find()->where(['parent_id' => $model->id])->all(); foreach ($...
Siti Anasuha's user avatar
0 votes
1 answer
37 views

Email can't be sent from yii2 application on cpanel

I have developed a yii2 application and deployed it in a CPanel on Bluehost. I created an email account in the CPanel to send emails using swiftmailer. When I use the email in localhost (my pc) it is ...
Zainab's user avatar
  • 1
1 vote
0 answers
20 views

How to add text-highlight in asmoday74\ckeditor5\EditorClassic in Yii Framework?

I'd like to add to my EditorClassic Yii component the possibility of highlighting text with colors. This is the current component, it has by default options such as bold, italic, underline etc. <?...
Abdelilah Dahdahi's user avatar
2 votes
0 answers
24 views

Yii2 console commands are just echoing list of commands

All of my Yii console commands are just echoing this: This is Yii version 2.0.49. The following commands are available: - asset Allows you to combine and compress your ...
Regular User's user avatar
3 votes
0 answers
17 views

How to include Yii framework to custom file

I have a custom file soccer.php that should use models form backend folder. This file is in cron folder and project structure looks like this: - project/ - backend/ - cron/ soccer.php - ...
Regular User's user avatar
1 vote
0 answers
45 views

How can I export a PDF file using MYExportMenu in Yii?

I'm trying to export a PDF file using MYExportMenu widget in Yii framework. This is currently what it looks like : //...other MYExportMenu configuration MYExportMenu::FORMAT_PDF => [ ...
Abdelilah Dahdahi's user avatar
0 votes
0 answers
28 views

Yii2 cross origin error on file upload api and other request working fine

I've created yii2 api. I've cross origin origin error on file upload all other request working fine like get, post, put, delete, issue has been blocked by CORS policy: Response to preflight request ...
EzyPrint's user avatar
0 votes
0 answers
9 views

The OPAC display on my library's official website displays an error?

Good morning, Please help. The OPAC display on my library's official website displays an error like the following display. enter image description here or in link perpustkaan.icpasuruan.sch.id/opac ...
Darwis Faisal Maulana's user avatar
0 votes
1 answer
45 views

not passing variable from controller to template yii2

I have controller public function actionIndex() { $rows = Players::find()->all(); return $this->render('index', [ 'rows' => $rows ]); } and view ...
Vyacheslav's user avatar
0 votes
0 answers
89 views

Troubleshooting "Class 'CMap' not found" Error in Yii Project

I'm trying to set up an older Yii project on my local environment (using Laragon), and I'm encountering the following error: Fatal error: During inheritance of IteratorAggregate: Uncaught Error: Class ...
kaushalya senarathna's user avatar
0 votes
3 answers
38 views

How can I load a controller action from loading up a blank URL in Yii2?

I'd like to be able to load up a frontend controller action from a default URL eg. www.mywebsite.com and have it load up the frontend siteController::actionMain(). Is there any changes I can make in ...
HJP22's user avatar
  • 33
0 votes
0 answers
80 views

Webpack vs Vite for PHP (Yii2) SSR. Is there a built-in dead code eliminating feature in Vite?

I need to eliminate dead code and render blocking things in a PHP project. The issue of optimization is very acute. I need to either configure webpack and manually add TreeShaking and some things that ...
thirtythreeboas's user avatar
0 votes
0 answers
20 views

YII: GridView: What's the right way to add date filter?

How I do it so far: GridView::widget([ 'columns' => [ [ 'attribute' => 'my_date', 'value' => function($data) { return $data->my_date ? DateTime::...
NicOwen's user avatar
  • 191
-1 votes
1 answer
80 views

How can I resole a fatal error that appeard after updating Craft CMS?

I want to update to a newer craft CMS version, and I tried to do it in the control panel. The latest available version was 3.7.12. After I clicked on update all I got the following error: Fatal error: ...
Nicky Ichov's user avatar
0 votes
0 answers
70 views

The connection timed out after 30 sec while awaiting incoming data

PHP Fatal error: Uncaught exception 'PhpAmqpLib\Exception\AMQPTimeoutException' with message 'The connection timed out after 30 sec while awaiting incoming data' in /var/code/www/thebank.vn/vendor/...
Trung Nguyen's user avatar
0 votes
1 answer
28 views

How to change a navbar item link

I have this PHP application with set navigation bar items that I want to add to them the item "Tutorial" navigation bar items with the one I need to add "tutorial" The themes/...
Wellbeing Toolkit's user avatar
0 votes
0 answers
74 views

Yii3 and Docker: how to install and run a project

i know that Yii3 is in developing, but i want to try and explore it. I want to install it and run with Docker but i've never used Docker so i'm in difficult: How can i install Yii3 and run it using ...
Simone-98's user avatar
1 vote
0 answers
42 views

How to find, from where does a Yii method fetch data to query and how to update the query in the method to comply with GROUP BY?

I am new to Yii (not to PHP though) I am trying to fix a Yii site that was created by someone else. Data / contents are not shown after PHP and mySql update I have this method in /var/www/html/connect/...
coderookie's user avatar
0 votes
0 answers
27 views

PDOException:SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated [duplicate]

My Yii framework website was working fine until I decided to upgrade the PHP. It was 5+ version. My current environment: 1. ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu)) 2. mysql Ver 8.0.33-0 3. PHP ...
coderookie's user avatar
1 vote
1 answer
111 views

SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "project_id" violates not-null constraint

I have the following error in php (Yii2 Framework): Error: Integrity constraint violation – yii\db\IntegrityException SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "...
Mikel's user avatar
  • 11
0 votes
2 answers
18 views

installing yii2 on a host that does not allow placing files outside of the htdocs folder

The problem is, as the title mentions, how to install yii2 on a hosting that does not allow files to be placed outside the htdocs folder. the hosting is byhost: not allow files to be placed outside ...
Tierra Perdia's user avatar
1 vote
1 answer
115 views

Unable to run Yii migration

I run few commands : yii migrate and $ yii migrate/data templatedata $ php yii migration/data templatedata but all of the command that i run return the value : bash: yii: command not found I have ...
hem's user avatar
  • 11
0 votes
1 answer
196 views

Yii2 - How to set checkbox to be checked and saved in settings by default?

Hello guys i have problem with checkboxes i must set it by default to be checked , other guy programmed this and i'm new on this code so if someone know how to fix this i will be grateful. Here is my ...
Bosnian Developer's user avatar
0 votes
0 answers
26 views

Craft CMS database caching in Queue?

I’m having trouble figuring something out. I don’t yet have a lot of experience with Craft CMS or the Yii framework it’s build on but this is my current situation. From an external API, I make a ...
LaurentMe's user avatar
1 vote
3 answers
83 views

How to pass submit button name and value in post request if yii confirmation dialog is used?

Then I don't use yii confirmation dialog i can see submit button's name and value in post request. If I use yii confirmation dialog i can't see submit button's name and value in post request. How to ...
Alexander Smirnov's user avatar
0 votes
0 answers
14 views

Configuration of a legacy project with YiiFramework 1.1 on Apache2 in Linux Mint 21

I possess a project in PHP 7.3 that utilizes the YiiFramework 1.1. Previously, I was using it on Windows 10 with XAMPP, and it functioned as expected. The issue I am facing is that after installing ...
Bryan Henrique Cruz 's user avatar
0 votes
0 answers
75 views

Yii2 Pjax form to update div's with ID

I have a form that looks like this <?php \yii\widgets\Pjax::begin(['id' => 'calculator-pjax']); $form = ActiveForm::begin([ 'id' => $model->formName(), '...
Shaho's user avatar
  • 187
0 votes
0 answers
54 views

yii Ajax posts validates twice

I have a form that looks like this <?php $form = ActiveForm::begin([ 'id' => $model->formName(), 'enableAjaxValidation' => true, 'enableClientValidation'=&...
Shaho's user avatar
  • 187
0 votes
1 answer
60 views

How to inject sql hints into the query with yii2

Is there any way to inject a SQL hint into ActiveRecord sql query before execution? Like adding a comment before the SQL (/* query id */ SELECT ...). This can be done by manipulating yii\db\Command ...
user2531657's user avatar
0 votes
1 answer
42 views

unable to add pdo_mysql to PHP Modules although i have modified php.ini file

php -m [PHP Modules] bcmath calendar Core ctype date dom filter hash iconv json libxml mysqlnd pcre PDO Phar readline Reflection session SimpleXML SPL standard tokenizer xml xmlreader xmlwriter zip ...
Peppo 10's user avatar
0 votes
0 answers
49 views

I want serve yii application by php yii serve but show me this errors

The installation status is available in the picture Warning: require(C:\xampp\htdocs\yii\web/../vendor/autoload.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\yii\web\index....
morteza heydari's user avatar
0 votes
0 answers
30 views

Redirecting a url with urlManager in yii1.1

I'm trying to redirect the following url structure in Y1.1 /info/#/[string] to /site/info?value=[string] I tried 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>...
Andrew Sparrow's user avatar
0 votes
1 answer
34 views

In Yii, can I set my search result page headers dynamically to include the search phrase?

I don’t even know how to write an example of this, sorry. I want my search result pages to include the search term in the h1 on the page. In my current site, I am able to simply echo the URL parameter ...
David Rhoden's user avatar
0 votes
0 answers
16 views

Yii2: How to get around the "the data being deleted is outdated" when using optimistic locking? [duplicate]

I am writing todo app in Yii2 using optimistic Locking. I need to write delete action now. How to get around the "the data being deleted is outdated" when using optimistic locking? As we ...
Azizxon Zufarov's user avatar
1 vote
0 answers
378 views

How to configure Memcached to able to store Cache larger than its default?

Im using Yii2 as a framework, and start working with cache, what i wanted to do is minimally the transaction to the database by storing about 700.000+ rows from database table cached in Memcached, its ...
Irvan Hilmi's user avatar
0 votes
1 answer
94 views

How to write delete action using Optimistic Locking in Yii2?

I am writing todo app in Yii2 using optimistic Locking. I need to write delete action now. I tried to write model, controller and also view for this purpose. I use this documentation link :https://www....
Azizxon Zufarov's user avatar
0 votes
1 answer
122 views

How to write update action using Optimistic Locking in Yii2?

I am writing todo app in Yii2 using optimistic Locking. I need to write update action now. I tried to write model, controller and also view for this purpose. I use this documentation link :https://www....
Azizxon Zufarov's user avatar
0 votes
1 answer
95 views

How to get the route from UrlRule in yii/craft cms

I have route in my routes.php file and I also have routes in my module like so: return [ 'analytics/<tenantSlug:{slug}>/modules/' => ['route' => 'analytics/modules/list', 'name' => '...
Ross Lote's user avatar
  • 824
0 votes
1 answer
80 views

Yii2 Using Multiple Checkbox Fields

I have a Yii2 app in which I want to use multiple checkbox as array. The checkbox is part of my Model, but it's not a DB column. It also has a custom value. I loop through a list of days, set a custom ...
Quentinb's user avatar
  • 476
0 votes
2 answers
46 views

HTML Bootstrap Coding | Cards

I am using a bootstrap to create cards for my site. I am trying to center the card contents of the grid image cards. I have tried applying class="center" into various parts and the items are ...
noobcoder's user avatar
2 votes
1 answer
286 views

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) YII2 in local

So I just downloaded yii2 project from server using Winscp to run it in my local, but when I run it gives me the error: CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1045] Access ...
sanxerta's user avatar
1 vote
2 answers
363 views

list is not in GROUP BY clause and contains nonaggregated column in X2CRM

I have created a custom module in X2CRM. Then, I created a new record in that module and logged time using the Log Time widget. Ultimately, when I retrieve the same record by clicking on that record ...
Asad Ali's user avatar
  • 331
0 votes
1 answer
56 views

Microsoft Outlook Email not working with Manage Apps anymore

We have had Microsoft Outlook email configure in our X2CRM previously. Since, the Microsoft has updated their Exchange and disable the Basic Authentication, we are left without any email integration ...
user avatar
0 votes
0 answers
105 views

Hide data in url when using window.open in jquery

i was performed onclick to download pdf in below there is my jQuery code $("#mlt_voucher").on("click", function () { var checkedId = []; var deduction = $('#...
Bhavesh Sahu's user avatar

1
2 3 4 5
336