SparkViewEngine:是否有相当于 PHP Include 的可用功能?
我正在将 SparkViewEngine 与 ASP.NET MVC 1.0 一起使用,并且想知道是否有办法在当前视图中包含另一个视图。
例如,我有一个名为 ResourceManager.spark 的视图。 在此文件中,我想包含另一个名为 Resources.spark 的子视图。
谢谢! 安倍
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以使用部分文件。其语法是,
它将在 View/> 中查找名为 Resources.spark 的文件。目录,如果在共享目录中找不到该目录。
如果您将文件命名为 _Resources.spark,那么您还可以将其用作自定义元素(无下划线),如需
了解更多信息,请参阅 http://sparkviewengine.com/documentation/organizingcontent#Parsingandrenderingpartialfiles
Yes you can using a partial file. The syntax is
it will then look for a file called Resources.spark in the View/
<ControllerName
> directory and if that isn't found in the shared directory.If you name the file _Resources.spark then you could also use it as a custom element (sans the underscore) like so
for more information see http://sparkviewengine.com/documentation/organizingcontent#Parsingandrenderingpartialfiles
当然,您可以使用命名内容区域。
查看 Spark 网站 上的文档
DimeCasts.Net
Sure, you can use named content areas.
Take a look at the documentation on the Spark website
There is also a good video tutorial at DimeCasts.Net