Category: Web Application Development
-
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: 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…
-
Post Views: 22 1. The PHP code is implemented as follows 2. When the response is a non-picture buffer, the data written in the picture file is incorrect. Image cannot be opened. The final decision is made to distinguish through the response header content-type. as shown in Figure 1 3. When the response is a non-picture buffer, yii\web\serverErrorHttpException: Failed to…
-
Post Views: 17 1. Prompt in phpstorm: potential polymorphic calls. There are no members in the hierarchy of requests. as shown in Figure 1 2. Print $this->request and confirm that it is yii\web\request object. as shown in Figure 2 3. This is because $this->request is not explicitly marked by the type, and phpstorm cannot confirm its class type (i.e. $this->request…
-
Post Views: 17 1. Report an error in Yii2: Model Not Inserted Due to Validation Error. as shown in Figure 1 2. The code is implemented as follows 3. However, !$input->save(false) does not report an error. Problem analysis, the value of value is 444 (integer), but the rule requires that value must be a string. You need to convert the…