有电梯吗+扩展完整示例?
有 hello scalate 的例子,但是太简单了,不好学。 我想知道如何整合升力和升级,例如升力彗星、升力形式...
There are hello scalate example, but it's too simple to learn.
I want to know how integirat lift and scalate, for example, lift comet, lift form ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实证明,Lift scalate 模块 (2.5) 的当前版本不起作用(在与代码片段和 Comet 集成的意义上)。问题是 scalate 模块将 scalate 渲染器放入管道中,作为生成完整响应的东西。
因此,您的诈骗文件将呈现,但它们不支持提升标签。
为了获得您真正想要的东西,您应该侵入模板加载器(幸运的是,Lift 允许您这样做)。
我玩了一下这个,并从模块中删除了一些代码。这对我有用(尽管它需要很多东西,例如模板缓存、区域设置支持、开发模式与生产模式,也许还有一些配置参数(例如,在生产模式下,您是否希望 scalate 每次都处理诈骗,或者只是在初始加载时处理) 其中
在 Boot.scala 中:
ScalamdTemplateLoader.scala 的
大部分代码是直接从模块中删除的(请参阅 ScalateView...这会导致 LiftResponse)...通过将其作为外部模板加载器放入并运行通过 S.htmlParser,我们最终得到一个输入到整个 lift 子系统的模板...scalate 用作 Lift 的模板源,而不是响应源
输入这样的模板时:
当我 从 Demo1 片段获取预期响应:
It turns out that the current incarnation of the Lift scalate module (2.5) does not work (in the sense of integrating with snippets and comet). The problem is that the scalate module puts the scalate renderer into the pipeline as something that generates a completed response.
Thus, your scaml files will render, but they will not support lift tags.
To get what you really want, you should hack into the Template loader (which Lift, fortunately, allows you to do).
I played with this a bit, and ripped off a bit of code from the module. This works for me (though it needs many things, like caching of template, locale support, development mode vs production mode, perhaps some config parameters (e.g. in production mode do you want scalate to process the scaml every time, or just on initial load?).
In Boot.scala:
where ScalamdTemplateLoader.scala is
most of this code is ripped directly from the module (see ScalateView...which results in a LiftResponse)...by putting it in as an external template loader, and running that through the S.htmlParser, we end up with a template that is fed into the entire lift subsystems...scalate is used as the template source for Lift, instead of the response source.
When I feed in a template like this:
I get the expected response from the Demo1 snippet:
与任何其他 Lift 模板机制相同。
可以调用片段:
Comet 只是一个片段:
https://groups.google .com/d/topic/liftweb/f_zOj3ZOLQg/discussion
The same way as with any other Lift templating mechanism.
Snippets can be invoked:
and Comet is just a snippet:
https://groups.google.com/d/topic/liftweb/f_zOj3ZOLQg/discussion
您可以在此 pdf 中找到很多内容
You will find lots of them in This pdf