Railo
  1. Railo
  2. RAILO-2160

enhance Replace() and ReplaceNoCase() to accept Struct

    Details

    • Type: Feature Request Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.1.0.000
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      it will be very useful to have a BIF that takes a text template and does a replaceAll with key/value pairs from a Struct.

      this can be useful in cases of mail-merge, a simple replacement for xmlTransform and other cases where the same text template needs to be populated with different values.

        Gliffy Diagrams

        1. jira-2160.cfm
          0.6 kB
          Igal .
        2. replace.cfm
          1 kB
          Igal .
        3. replaceNoCase.cfm
          1 kB
          Igal .

          Activity

          Hide
          Igal . added a comment -

          testcase attached

          Show
          Igal . added a comment - testcase attached
          Hide
          Peter Boughton added a comment -

          Seems an odd name?

          Also, was expecting "template" to be a file, not a string. (Consistent with <cfinclude template="filename" /> etc )

          Show
          Peter Boughton added a comment - Seems an odd name? Also, was expecting "template" to be a file, not a string. (Consistent with <cfinclude template="filename" /> etc )
          Hide
          Igal . added a comment -

          it's a Text Template, just like template="filename.cfm" is a cfm template.

          anyway, the name doesn't matter that much. it can be PopulateText() or ReplaceMap() or just replace() where the 2nd arg is a struct, i.e. replace( string, struct )

          Show
          Igal . added a comment - it's a Text Template, just like template="filename.cfm" is a cfm template. anyway, the name doesn't matter that much. it can be PopulateText() or ReplaceMap() or just replace() where the 2nd arg is a struct, i.e. replace( string, struct )
          Hide
          Igal . added a comment -

          testcase

          Show
          Igal . added a comment - testcase
          Show
          Michael Offner added a comment - https://github.com/getrailo/railo/commit/eaf46fa12cf68039bfa7d8a2b29dcacef9ab8358

            People

            • Assignee:
              Igal .
              Reporter:
              Igal .
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development