|
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 |
torpedo Smarty n00b
Joined: 05 Aug 2016 Posts: 2
|
Posted: Fri Aug 05, 2016 4:15 pm Post subject: how can i make this work? |
|
|
i tried several things but nothing worked..
i just need to add the id of the method into the input field..
<td class="radiobutton">{$method_data.radio_field|replace:'<input type':'<input class="with-gap" id="{$method_data.id}" type'}<label for="{$method_data.id}">{$method_data.title} </label></td>
any help would be appreciated |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Sun Aug 07, 2016 1:56 pm Post subject: Re: how can i make this work? |
|
|
If I'm right Smarty inside a modifier will not work.
Try something like this
Code: |
{$rbutton = str_replace('<input type', '<input class="with-gap" id="{$method_data.id}" type', $method_data.radio_field}
<td class="radiobutton">{$rbutton}<label for="{$method_data.id}">{$method_data.title} </label></td> |
|
|
Back to top |
|
torpedo Smarty n00b
Joined: 05 Aug 2016 Posts: 2
|
Posted: Sun Aug 07, 2016 5:23 pm Post subject: |
|
|
hmm, doesnt work.. |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Mon Aug 08, 2016 11:25 am Post subject: |
|
|
Do you got an error message?
What says the error log?
Which Smarty version do you are using? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Oct 25, 2016 3:24 am Post subject: |
|
|
The problem is that the second parameter was a single quote string. So the {$method_data.id} was not detected as a smarty tag. make it double quoted and escape the existing '"'.
Code: | <td class="radiobutton">{$method_data.radio_field|replace:'<input type':"<input class=\"with-gap\" id=\"{$method_data.id}\" type"}<label for="{$method_data.id}">{$method_data.title} </label></td>
|
|
|
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
|