Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-619

New set modifier so that set only assigns a value when variable is not defined.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      Define a new #set modifier such that a variable is only set if it is not defined, like so:

      #set($!foo = "bar")

      If the '!' character proceeds the variable foo, then $foo will be set with the value of "bar" ONLY IF $foo is not defined (is not in the context). Otherwise if $foo is defined it will remain unchanged.

        Attachments

        1. setBangModifier_2.patch
          3 kB
          Byron Foster

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              byronvf Byron Foster
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: