/samples/scalate-sample/src/main/webapp/ssp/renderTemplate.ssp
http://github.com/scalate/scalate · Unknown · 42 lines · 28 code · 14 blank · 0 comment · 0 complexity · f37204c978f6d1b03503d419046b160a MD5 · raw file
- <%--
- Copyright (C) 2009-2011 the original author or authors.
- See the notice.md file distributed with this work for additional
- information regarding copyright ownership.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- --%>
- <h2>Render Template</h2>
- <h3>Absolute Layout</h3>
- <p>This page renders a template passing the body of the current template</p>
- <% layout("/WEB-INF/partials/sample.ssp", Map("name" -> "James")) { %>
- location: <b>London</b>
- <%}%>
- <h3>Relative Layout</h3>
- <% layout("localPartial.ssp", Map("name" -> "Hiram")) { %>
- location: <b>Tampa</b>
- <%}%>
- <h3>Relative Render passing body as parameter</h3>
- <% render("localPartial.ssp", Map("body" -> "location: <b>No Location</b>", "name" -> "Matt")) %>
- <h3>Relative Render using symbols as keys</h3>
- <% render("localPartial.ssp", Map('body -> "location: <b>USA</b>", 'name -> "Paul")) %>