Tag: Yii
-
Post Views: 29 1. Implement the corresponding RESTful-style web service API of the page in the API directory, and then adjust it to the RPC client 2. After all the corresponding APIs of the page are implemented, the POST request is executed in Postman, and the response is normal, as shown in Figure 1 3. Execute the PUT /pages/1 request…
-
Post Views: 32 1. Based on yii2tech\ar\SoftDelete\SoftDeleteBehavior, the soft deletion of ActiveRecord is realized, and the URL is opened:https://github.com/yiisoft/yii2/blob/master/docs/guide-zh-CN/concept-behaviors.md, as shown in Figure 1 2. Install the ActiveRecord extension of Yii2, use the self-update command to update the composer to the latest version, use the update command to obtain the latest version of the dependencies, and upgrade the composer.lock file,…
-
Post Views: 53 1. Use updateAll() to update the value of prev_status to the value of status, and update the value of status to 4, the table structure is shown in Figure 1 2. Based on the query builder, the code is as follows 3. However, it does not meet the expectations. The values of prev_status are updated with 0,…
-
Post Views: 12 1. Edit \api\config\urlmanager.php, define the route to support put close/{id} 2. Edit \API\Controllers\PlantaskController.php, and define the action to support the close method 3. Edit \API\RESTS\plan_task\action.php, copy public function findModel($id) to public function findModels($id) to support finding multiple models 4. All IDs must exist, otherwise the response will fail, as shown in Figure 1 5. Create a new…
-
Post Views: 14 1. The previous article:https://www.shuijingwanwq.com/2018/01/18/2328/ 2. Refer to step 11, the DB component is moved to the development environment to facilitate the use of GII, \common\config\base.php, as shown in Figure 1 3. Configured as a production environment, so that the multi-tenant implementation of the test database migration is not dependent on the DB component, as shown in Figure…
-
Post Views: 57 1. Error report: unserialize(): unexpected end of serialized data, as shown in Figure 1 4. Edit \framework\web\CurlManager.php, and print out self::cache_key, as shown in Figure 4 5. Print the result, its value is: yii.curlmanager.rules, as shown in Figure 5 6. Open the URL: https://github.com/yiisoft/yii/issues/4137 and find that there is the same problem, as shown in Figure…