Skip to content

Use named arguments in slim_block to add templating support to non-code arguments. #51

@rdinnager

Description

@rdinnager

It would look like this:

slim_block(1, ..end_gen.. = 1000, { code_goes_here }). So the same rules apply as for a normal slim_block() call, but if one of the arguments is named, the name is interpreted as a templated variable name, and the argument value is the default value for that templated variable. Require the ..var.. pattern for consistency with slimr_template(). The end_gen templated variable could then be replaced in a slim_script_render() call with a list element named "end_gen".

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions