Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
从视图文件中我知道我可以调用访问@virtual_path 实例变量来获取正在呈现的模板文件的名称。当我从布局访问这个变量时,正如预期的那样,我得到了布局文件名。有没有办法访问从布局中呈现的主视图模板文件的名称?
布局和模板之间有区别吗?
也许其中一种想法对您有用:
@app_name @app_path <%= self._template.identifier %>