1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Add "Adding You Own Template Engine" section to README.

This commit is contained in:
Konstantin Haase 2011-01-11 11:02:29 +01:00
parent d7aa6a3b83
commit 9269686ad6

View file

@ -643,6 +643,23 @@ To associate a file extension with a template engine, use
Tilt.register :tt, Tilt[:textile]
=== Adding You Own Template Engine
First, register your engine with Tilt, then create a rendering method:
Tilt.register :myat, MyAwesomeTemplateEngine
helpers do
def myat(*args) render(:myat, *args) end
end
get '/' do
myat :index
end
Renders <tt>./views/index.myat</tt>. See https://github.com/rtomayko/tilt to
learn more about Tilt.
== Helpers
Use the top-level <tt>helpers</tt> method to define helper methods for use in