php - Regex search for Smarty template -
i have fields names such as:
home_phone company_phone mobile_phone other_phone_c personal_phone_c
and have smarty variable populate input values field values:
value="{$fields.{{$prefix}}_phone}"
but ones suffix _c
not outputting, since don't match pattern.
is there way append kind of regex values either end after phone
or _c
, like:
{$fields.{{$prefix}}_phone{regex | ($|_c$)}}"
use this: .*_(?:phone|phone_c)$
it match desired strings, ends _phone
or phone_c
.
Comments
Post a Comment