JGeer
JGeer

Reputation: 1852

Edit php template

I want to edit my php template, but I can not get it right. I use the the Smarty template engine.

My default php line looks like this:

{$customfield.input|replace:'>' : 'class="form-control" >'}

I have another php tag like, that I want to combine: {$customfield.name}

I tried this, but that does not work:

{$customfield.input|replace:'>' : 'placeholder="'.{$customfield.name}.'" class="form-control" >'}

How can I fix this?

Upvotes: 0

Views: 90

Answers (1)

Borgtex
Borgtex

Reputation: 3245

Your syntax is wrong. You can't use "." to concatenate strings in smarty. Try this instead:

{$replaceby = 'placeholder="'|cat:$customfield.name|cat:'" class="form-control" >'}
{$customfield.input|replace:'>' : $replaceby}

Upvotes: 1

Related Questions