Safe Haskell | None |
---|
- utilSplices :: MonadSnap m => Splices (Splice m)
- refererCSplice :: MonadSnap m => Splice m
- paramSplice :: MonadSnap m => Splice m
- scriptsSplice :: MonadIO m => FilePath -> String -> Splice m
Documentation
utilSplices :: MonadSnap m => Splices (Splice m)Source
refererCSplice :: MonadSnap m => Splice mSource
paramSplice :: MonadSnap m => Splice mSource
Gets the value of a request parameter. Example use:
:: MonadIO m | |
=> FilePath | Path to the directory on disk holding the javascript files. |
-> String | A prefix to add to the src attribute of each script tag. |
-> Splice m |
Searches a directory on disk and all its subdirectories for all files with names that don't begin with an underscore and end with a .js extension. It then returns script tags for each of these files.
You can use this function to create a splice:
("staticscripts", scriptsSplice "static/js" "/")
Then when you use the <staticscripts/>
tag in your templates, it will
automatically include all the javascript code in the static/js
directory.