简体   繁体   English

在NHaml中创建增量占位符

[英]Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. 我想了解的是一种在母版中添加脚本和样式占位符的方法。 They will include my initial site.css and jquery.js files. 它们将包括我的初始site.css和jquery.js文件。 Each haml page or partial can then add their own required files to those placeholders. 然后,每个haml页面或部分页面可以将自己所需的文件添加到这些占位符。

Currently I'm creating two strings in my master that I append to in my views. 目前,我正在母版中创建两个字符串,并将其附加到视图中。
This results in an ugly and error prone rendering. 这导致了丑陋且易于出错的渲染。
Is there a better way to implement this? 有没有更好的方法来实现这一目标?

Is there a better way to implement this? 有没有更好的方法来实现这一目标?

Yes. 是。 This is how I did it and so far it works great for me. 这就是我的操作方式 ,到目前为止,它对我来说非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM