conbask
conbask

Reputation: 10061

Percent sign after Smarty variable

in my setup double percent signs are variable delimiters (i.e.%%first_name%%). I'd like to have a percent sign after the inputted variable but it always seems to break when i try %%percent%%%. How can I insert a percent sign after the variable?

Thanks

Upvotes: 1

Views: 1351

Answers (3)

dev-null-dweller
dev-null-dweller

Reputation: 29462

There's what literal is for, so it should look like this:

%%$variable%%%%literal%%%%%/literal%%

but that looks so wrong that I'm not recommending to use it.

Upvotes: 0

Pandaski
Pandaski

Reputation: 140

Don't know if

%

working in this case

Upvotes: 2

Matt Lacey
Matt Lacey

Reputation: 8255

Maybe try escaping the one you want?

%%percent%%\%

You may need to escape the backslash also, though I doubt it in this scenario, that's usually something that comes into play with regular expressions because you need to pass the backslash in as a literal part of the expression.

%%percent%%\\%

Upvotes: 0

Related Questions