|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mik3e Smarty n00b
Joined: 20 Aug 2013 Posts: 4
|
Posted: Wed Sep 18, 2013 1:30 pm Post subject: Use a config variable {#var#} inside smarty expression |
|
|
Hi,
I´ve the need to use a config variable inside a smarty expression. In this example I´ve a regular expression where I want to add a language dependend text ({#new_address#}):
Code: | {$BUTTON_NEW|regex_replace:'/<a[^>]*href="([^"]*)"[^>]*>.*<\/a>/':'<a href="$1" class="btn btn-primary">#new_address#</a>'} |
Can anyone give me a hint how to do that?
Thanks a lot,
Michael |
|
Back to top |
|
mik3e Smarty n00b
Joined: 20 Aug 2013 Posts: 4
|
Posted: Wed Sep 18, 2013 1:58 pm Post subject: |
|
|
After some experiments I found the solution - maybe someone need it also:
Code: | {$BUTTON_NEW|regex_replace:'/<a[^>]*href="([^"]*)"[^>]*>.*<\/a>/':'<a href="$1" class="btn btn-primary">'|cat:$smarty.config.add_new_address|cat:'</a>'} |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|