@@ -127,7 +127,18 @@ private function resolveNewAttribute($arguments, $attributeValue, $matches)
127127 $ newAttributeVal = $ attributeValue ;
128128 foreach ($ matches [1 ] as $ var ) {
129129 if (array_key_exists ($ var , $ arguments )) {
130- $ newAttributeVal = str_replace ($ var , $ arguments [$ var ], $ newAttributeVal );
130+ if (preg_match ('/\$\$[\w.\[\] \',]+\$\$/ ' , $ arguments [$ var ])) {
131+ //if persisted $$data$$ was passed, return $$param.id$$ instead of {{$$param$$.id}}
132+ $ newAttributeVal = str_replace ($ var , trim ($ arguments [$ var ], '$ ' ), $ newAttributeVal );
133+ $ newAttributeVal = str_replace ('{{ ' , '$$ ' , str_replace ('}} ' , '$$ ' , $ newAttributeVal ));
134+ } elseif (preg_match ('/\$[\w.\[\] \',]+\$/ ' , $ arguments [$ var ])) {
135+ //elseif persisted $data$ was passed, return $param.id$ instead of {{$param$.id}}
136+ $ newAttributeVal = str_replace ($ var , trim ($ arguments [$ var ], '$ ' ), $ newAttributeVal );
137+ $ newAttributeVal = str_replace ('{{ ' , '$ ' , str_replace ('}} ' , '$ ' , $ newAttributeVal ));
138+ } else {
139+ //else normal param replacement
140+ $ newAttributeVal = str_replace ($ var , $ arguments [$ var ], $ newAttributeVal );
141+ }
131142 }
132143 }
133144
0 commit comments