Bug 60503 - Feature request: mod_macro - allow optional parameters
Summary: Feature request: mod_macro - allow optional parameters
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Other Modules (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-21 14:17 UTC by xxxargonxxx
Modified: 2023-06-15 07:13 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xxxargonxxx 2016-12-21 14:17:27 UTC
Would be very useful to allow optional parameters for macroses (mod_macro) and add something like <IfParameterDefined paramName> directive to use inside macro definition.
Comment 1 Ryan Ollos 2019-11-15 18:55:25 UTC
Also to allow default values to be assigned to parameters, though I suppose that could effectively be done with a `<IfParameterDefined paramName>` directive.
Comment 2 Marc Stern 2023-06-15 07:13:24 UTC
What about a simple syntax like this:
<Macro Mymacro $p1 @p2 $p3="default value" @p4="" $p5="another default value">

Simple to write, simple to read, reasonably compact.
If everybody agrees I'm ready to help adapting the code and testing.