Tag: messages
-
Post Views: 16 1. Reference URL:https://www.shuijingwanwq.com/2021/01/22/4698/. The queue/run command replaces the queue/listen command. In the local environment, check the status of the queue of queue/run commands. 2. Check the queue data in redis, cpa:queue:copy:asset.messages. The amount of data is 20. as shown in Figure 1 3. Open 2 command line windows, run the queue in window 1, and then run…
-
Post Views: 17 1. Error in Yii 2.0: ExceptionYii\Base\InvalidConfigExceptionwith messageUnable to local message source for categoryError.. as shown in Figure 1 2. Edit ccp/config/console.php, add components: i18n 3. Run the command line again, and report an error: ExceptionYii\Web\NotFoundHttpExceptionwith message205064. as shown in Figure 2 4. Create a new directory, /ccp/messages. The contents of the file /ccp/messages/en-cn/error.php are as follows. as…
-
Post Views: 16 1. The tester submitted a bug, and when the uniqueness verification fails, the prompt is not friendly enough (Chinese and English are mixed, and the user is not easy to understand), the prompt information is shown in Figure 1 2. In the latest version of the local environment, when it is ready to reappear, all the prompt…
-
Post Views: 16 1. The previous implementation is as follows, the configuration file in the public directory, \common\config\main.php, the international configuration is as follows: 2. The files in the message directory (messages) in the public directory are as follows: \common\messages\zh-cn\error.php \common\messages\zh-cn\error.php 3. The files in the message directory (Messages) in the interface application are as follows: \API\Messages\zh-cn\Error.php \API\Messages\zh-cn\success.php 4. The…
-
Post Views: 12 1. Install the Yii2 queue extension and execute the following commands 2. Check composer.json, the installation has been successful 3. Register multiple queue components to the console, edit \console\config\main.php 4. Configuration of multiple queue components, editing \environments\dev\common\config\main-local.php, \environments\prod\common\config\main-local.php 5. Define the basic class of each task sent to the queue, create a new \common\jobs\job.php 6. Each task…
-
Post Views: 18 1. Reference URL:https://www.yiiframework.com/doc/guide/2.0/zh-cn/input-multiple-models, it is suitable for web forms, but the request parameters of the API application generally do not add the form name (especially when the single model is entered), so it is not suitable, for example: the table name is article_type, the field name is code, then the request parameter name is article_type_code, not: articleType[‘code’],…
-
Post Views: 71 1. RESTful web service, it is recommended to implement based on a separate interface application, at this time, it is implemented based on the API application 2. Create a new directory: \api\rests, this directory will be used as the operation method category directory of the RESTful web service 3. Create a new controller class \API\Controllers\UserController.php , and…
-
Post Views: 67 1. Definition and specification: Define: (1) Data layer: Models is used to define automatic verification and automatic completion and data access interfaces related to data; (2) Logical layer: Logics is used to define the business logic related to data; Specification: (1) The model class file in the /common/models directory is only allowed to be generated by the…
-
Post Views: 14 1. In Windows PowerSHLL, enter the E:\wwwroot\cmcp-api directory, as shown in Figure 1 2. Create a new application API, copy the backend directory as the API, as shown in Figure 2 3. Edit \.env.dist, add API-related configuration, this is the configuration file submitted to Git version control, as shown in Figure 3 4. Edit \.env, add the…