Tag: yiisoft/yii2-app-advanced
-
Post Views: 37 1. Implement the corresponding RPC service of the page in the RPC directory, create a remote procedure call HTTP server, and create a new \RPC\Controllers\ServerController.php 2. Create a new page model \rpc\models\page.php 3. Create a new page controller, \rpc\controllers\pagecontroller.php 4. Then open the URL on the browser side:http://rpc.github-shuijingwan-yii2-app-advanced.localhost/page/create, see the following output: Fa2{u#s11″page_create”}z, as expected 5. Create…
-
Post Views: 15 1. Reference URL:https://www.shuijingwanwq.com/2020/01/19/3869/, upgrade Yii Framework from version 2.0.15.1 to 2.0.31 2. In some use: \guzzlehttp\json_encode, \guzzlehttp\json_decode Error in the program, the final analysis found that the reason is that the directory: /vendor/guzzlehttp/guzzle, /vendor/guzzlehttp/promises no longer exists. as shown in Figure 1 After careful analysis, find the second step in the reference URL, run the Composer Update…
-
Post Views: 45 1. Since the log message is stored in the log table of mysql, in the production environment, a large amount of data has been accumulated, and the data length of the log table has reached hundreds of gigabytes. Therefore, it is decided to implement the timing deletion of log messages based on the console command line, and…
-
Post Views: 41 1. In Postman, posthttp://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users201 response, the status value is 1 by default 2. In Postman, deletehttp://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users/1, 200 responses 3. In Postman, posthttp://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users,422 response, not as expected, expected to be 201 response, because “username”: “111111” has been deleted 4. Create a new \console\migrations\m180925_054952_add_is_deleted_and_deleted_at_to_user.php. Update field, status, status, 0: disabled; 1: enabled, default: 1. Added field, is_deleted, whether it…
-
Post Views: 13 1. There are 3 applications in the directory structure at this stage, namely: Frontend, Backend, and API, and their domain names are configured as :http://www.channel-pub-api.localhost/,http://www.channel-pub-api.localhost/backend,http://www.channel-pub-api.localhost/api 2. Edit the hosts file 3. Reference:https://github.com/mickgeek/yii2-advanced-one-domain-config/blob/master/vhosts/nginx.conf, edit \frontend\config\main.php 4. Edit \backend\config\main.php, set the baseURL, separate session and cookie 5. Edit \api\config\main.php 6. Edit \api\config\urlmanager.php 7. Edit \environments\dev\frontend\web\robots.txt, \environments\prod\frontend\web\robots.txt Before editing: After…
-
Post Views: 29 1. The API can distinguish application/x-www-form-urlencoded and multipart/form-data input formats by default, and view \api\config\main.php, request Configuration of application components 2. POST request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, the input format: application/x-www-form-urlencoded, as shown in Figure 1 3. Post request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, input format: multipart/form-data, as shown in Figure 2 4. Post request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, the input format: application/json, data…
-
Post Views: 64 1. Create a new warehouse, shuijingwan/yii2-app-advanced, as shown in Figure 1 Yii 2 advanced project template, the template includes four layers: interface (the API to implement the RESTful style web service service), front-end, back-end and console, each of which is a separate YII application. 2. Successfully created the warehouse, as shown in Figure 2 3. Use the…