Come utilizzare layout tramite ".scaml" in Play + play-scalate
-
28-09-2020 - |
Domanda
Sto usando Play Frameword e plugin in scala play.
La demo predefinita di play-scalate fornita è solo ".ssp", ma ciò che voglio usare è ".scaml".Creo un "default.scaml", ma non so come includere le viste interne.
Forse la mia descrizione non è chiara, quello che voglio fare è:
Traduci il layout "Main.html" su "default.scaml".
Il contenuto di "main.html" è:
<html>
<head>
</head>
<body>
#{doLayout /}
</body>
</html>
.
Non so come tradurre #{doLayout /}
.Grazie in anticipo.
Soluzione
dovrebbe essere:
-@ var body: String
-@ var title: String = "Some Default Title"
%html
%head= title
%body
%p hello, everyone
!= body
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow