【发布时间】:2018-10-29 23:54:49
【问题描述】:
我正在尝试使用动态 HTML id 来使用模式。
如果哈姆雷特接受[hamlet| <div .modal .fade ##{modalIdFunction i}> |]之类的东西,基本上我的问题就会解决
由于我在 Hamlet 中无法做到这一点,我正在尝试使用 Lucid 来做到这一点,但它与 Yesod 的 defaultLayout 不兼容。
这是我的意图:
getSupportR :: CustomerId -> Handler LucidHtml
getSupportR customerId = do
defaultLayout $ do
setTitle "Your Licenses"
toWidget . lucid $ \url ->
p_ $ a_ [href_ "\\"] "Link to root"
这是错误信息:
• Couldn't match type ‘blaze-markup-0.8.2.1:Text.Blaze.Internal.MarkupM
()’
with ‘HtmlT Identity ()’
Expected type: HandlerFor App LucidHtml
Actual type: HandlerFor App Html
有没有办法将 Lucid 的 LucidHtml 转换为 Blaze 的 Html?
我的整个代码在:https://github.com/hhefesto/laurus-nobilis 相关文件是 /src/Yesod/Lucid.hs 和 /src/Handler/Support.hs
【问题讨论】:
标签: haskell yesod blaze-html haskell-lucid