【发布时间】:2021-09-13 23:13:14
【问题描述】:
我正在使用 PhpStorm。我想在 Live Template 变量中使用 PHP 类中的方法名称。但是我在PhpStorm live template variables页面上没有找到它的功能。
有没有办法在模板中插入方法名?
/**
* @return Response
* @Route(path="/profile", name="profile")
*/
public function profile(): Response
{
return $this->render("app/profile/$HOW_TO_INSERT_METHOD_NAME_HERE$.html.twig");
}
【问题讨论】:
-
我认为这应该相当容易,只需使用模板中的相同变量作为方法名称本身。你能发布你的模板是什么样的吗?