Year: 2025
-
Post Views: 22 1. Execute the migration command: yii migrate –migrationpath=@yii/rbac/migrations, the field length of the string type is 64 2. Create a new migration in this plan, and then modify the length of the field. However, when executing the migration command, an error SQLState is reported[HY000]: General Error: 1833 Cannot Change Columnname: Used in a foreign key constraintauth_item_child_ibfk_1of table.…
-
Post Views: 17 1. In yii2, when the server is abnormal, it does not respond to 500, but prompts in the browser: CORS error, which leads to user experience, the front end has been loaded all the time. The prompts in the console are as follows, as shown in Figure 1 2. The existing logic is in the browser, the…
-
Post Views: 17 1. Request parameters in the interface 2. The final implementation of the Rules in the model is as follows 3. However, the value of the last write to mysql is 2025-04-05 07:59:59 4. yii::$app->formatter is a tool for display, not designed for the format of data storage. Decide to splicing directly, and finally achieve the following 5.…
-
Post Views: 17 1. In phpstorm, the prompt: the base class referenced by the subclass\common\models\conventionparticipantsharerecipientconstant in the constant. as shown in Figure 1 2. The code is implemented as follows common/models/conventionparticipantsharerecipient.php api/models/conventionparticipantsharerecipient.php API/Controllers/ConventionParticipantShareRecipientController.php 3. The adjustment code is implemented as follows, no longer prompted. as shown in Figure 2
-
Post Views: 16 1. In Yii2, when the model is loaded, it always returns FALSE. as shown in Figure 1 2. Find the reason, the $formname parameter of the load method needs to be assigned as, the filling model is successful
-
Post Views: 19 1. The result of preg_split after executing Chinese is garbled. as shown in Figure 1 2. Convert the string to UTF-8 before using preg_split(). u means Unicode (UTF-8) mode, avoiding Chinese character split errors. 3, the split is correct, no more errors.
-
Post Views: 17 1. In the end, it is decided to use the same commit ID first, and in the local environment, after executing the init prod command. as shown in Figure 1 2. The files that have been overwritten are sorted out the corresponding directory structure, including config and web. as shown in Figure 2 3. Then modify the…