monkeyDluffy6017 commented on code in PR #9753: URL: https://github.com/apache/apisix/pull/9753#discussion_r1246912701
########## docs/en/latest/plugin-develop.md: ########## @@ -488,9 +488,13 @@ curl -i -X GET "http://127.0.0.1:9090/v1/plugin/example-plugin/hello" ## register custom variable -We can use variables in many places of APISIX. For example, customizing log format in http-logger, using it as the key of `limit-*` plugins. In some situations, the builtin variables are not enough. Therefore, APISIX allows developers to register their variables globally, and use them as normal builtin variables. +We can use variables in many places of APISIX. For example, customizing log format in http-logger, using it as the key of `limit-*` plugins. In some situations, the builtin variables are not enough. Therefore, APISIX allows developers to register their variables globally, and use them as normal builtin variables. You can register simple variables like so: -For instance, let's register a variable called `a6_labels_zone` to fetch the value of the `zone` label in a route: +``` +ctx.my_var = my_data +``` Review Comment: I don't think it's some kind of apisix variable, it is just the usage of ngx.ctx -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
