Can I escape the dollar sign in a live template?
Hello,
I'm trying to create a live template where I want a $ display right in front of a live template variable. And I can't find a away to do so.
The live template idea is as follows:
public function set$attribute$($$attributeVar$) {
$this->_$attributeVar$ = $$attributeVar$;
}
With $attributeVar$ being set to decapitalize(attribute)
I want to produce something like
public function setName($name) {
$this->_name = $name;
}
Anyone have any ideas?
Thanks.
请先登录再写评论。
BTW, I'm using 8.1
With another $ sign.
So in your case
public function set$attribute$($$$attributeVar$) {
$this->_$attributeVar$ = $$$attributeVar$;
}
will produce the desired output.