Tagged: Yii 2

HttpException 表示由最终用户的不正确请求导致的异常 0

Chinese translation and annotation of predefined HTTP exception classes for Yii 2.0 (reference: MDN, Wikipedia)

浏览量: 41 1. Yii\Web\BadRequestHttpException: status code 400. BadRequestHttpExceptions a “bad request” Http exception with status code 400. Use this exception to represent a generic client error. Describes the error. In that case, consider using...

在浏览器打开网址:http://api.channel-pub-api.localhost/qq/v1/oauth2/authorize?group_id=015ce30b116ce86058fa6ab4fea4ac63 ,响应 HTML 格式,符合预期 0

In Yii 2, when processing a RESTful API request, the new response format is supported: text/html, and only the HTML format is supported

浏览量: 41 1. Open the URL in the browser: http://api.channel-pub-api.localhost/qq/v1/OA uth2/authorize?group_id=015ce30b116ce86058fa6ab4fea4ac63 , which responds to the XML format, because RESTful APIs support both JSON and XML formats. But HTML format is not supported. as...

打开 Windows PowerShell,执行 init 命令并选择 dev 作为环境,api应用所需环境配置文件自动生成 0

Based on yiisoft/yii2-app-advanced, create a new repository yii2-app-advanced on github, and create a new remote procedure call application (implement hprose 2.0 for PHP’s RPC server), support for creating new RPC directories, configuration and environment, testing, Vagrant, etc.

浏览量: 18 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...

passthru() has been disabled for security reasons 0

In Yii 2, the RPC service is implemented based on HProse, and the error is reported: passthru() has been disabled for security reasons

浏览量: 39 1. In the local environment, post in postman , http://api.aims-api.localhost/v1/tasks?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the response is successful 2. In development environment, post in postman , http://wjdev2.chinamcloud.com:8659/v1/tasks?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the response failed, as shown in Figure...

浏览 user 表数据,status、updated_at 已经更新 0

Based on yiisoft/yii2-app-advanced, create a new repository yii2-app-advanced on github, and create a new interface application (implement RESTful-style web service services. API), realize the soft deletion of ActiveRecord, generate ActiveQuery, and customize the query class

浏览量: 18 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...

在开发环境中,执行数据库迁移命令失败:1071 Specified key was too long; max key length is 767 bytes 0

Based on yiisoft/yii2-app-advanced, create a new repository yii2-app-advanced on github, and create a new interface application (implement RESTful-style web service services. API), adjust the default character set to: utf8mb4, the adjustment of the interface response format, the empty array is automatically converted to empty objects, and the request log message is collected in the interface application (1 request corresponds to 1 log message) to the database, and the corresponding interface to implement the log function: log list (set data filter to enable filter processing), log details (2)

浏览量: 45 1. In the development environment, the execution of the database migration command fails: 1071 Specified key was too long; Max key length is 767 bytes, as shown in Figure 17 2. Run...

在 Postman 中,GET http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/logs?filter[level]=4&filter[category][like]=api\behaviors\RequestLogBehavior&filter[prefix][like]=app-api&filter[log_time][gte]=1528090828&filter[log_time][lte]=1529564924.6648 ,200响应,空数组已经被自动转换为空对象,以保证字段格式的统一,GET http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/logs/3 0

Based on yiisoft/yii2-app-advanced, create a new repository yii2-app-advanced on github, and create a new interface application (implement RESTful-style web service services. API), adjust the default character set to: utf8mb4, the adjustment of the interface response format, the empty array is automatically converted to empty objects, and the request log message is collected in the interface application (1 request corresponds to 1 log message) to the database, and the corresponding interface to implement the log function: log list (set data filter to enable filter processing), log details

浏览量: 15 1. Set the default collation of the database as: utf8mb4_unicode_ci, as shown in Figure 1 2. Modify the default character set for database connections: utf8mb4, edit the configuration file in the development...