- class RenderRoute a => Yesod a where
- approot :: Approot a
- encryptKey :: a -> IO (Maybe Key)
- clientSessionDuration :: a -> Int
- errorHandler :: ErrorResponse -> GHandler sub a ChooseRep
- defaultLayout :: GWidget sub a () -> GHandler sub a RepHtml
- urlRenderOverride :: a -> Route a -> Maybe Builder
- isAuthorized :: Route a -> Bool -> GHandler s a AuthResult
- isWriteRequest :: Route a -> GHandler s a Bool
- authRoute :: a -> Maybe (Route a)
- cleanPath :: a -> [Text] -> Either [Text] [Text]
- joinPath :: a -> Text -> [Text] -> [(Text, Text)] -> Builder
- addStaticContent :: Text -> Text -> ByteString -> GHandler sub a (Maybe (Either Text (Route a, [(Text, Text)])))
- cookiePath :: a -> ByteString
- cookieDomain :: a -> Maybe ByteString
- maximumContentLength :: a -> Maybe (Route a) -> Int
- messageLogger :: a -> Loc -> LogLevel -> Text -> IO ()
- logLevel :: a -> LogLevel
- gzipSettings :: a -> GzipSettings
- yepnopeJs :: a -> Maybe (Either Text (Route a))
- jsLoader :: a -> ScriptLoadPosition a
- class YesodDispatch sub master where
- yesodDispatch :: Yesod master => master -> sub -> (Route sub -> Route master) -> (Maybe Key -> Application) -> (Route sub -> Maybe Key -> Application) -> Text -> [Text] -> Maybe Key -> Application
- yesodRunner :: Yesod master => GHandler sub master ChooseRep -> master -> sub -> Maybe (Route sub) -> (Route sub -> Route master) -> Maybe Key -> Application
- class Eq (Route a) => RenderRoute a where
- class YesodBreadcrumbs y where
- breadcrumbs :: YesodBreadcrumbs y => GHandler sub y (Text, [(Route y, Text)])
- data Approot master
- maybeAuthorized :: Yesod a => Route a -> Bool -> GHandler s a (Maybe (Route a))
- widgetToPageContent :: (Eq (Route master), Yesod master) => GWidget sub master () -> GHandler sub master (PageContent (Route master))
- defaultErrorHandler :: Yesod y => ErrorResponse -> GHandler sub y ChooseRep
- data AuthResult
- unauthorizedI :: RenderMessage master msg => msg -> GHandler sub master AuthResult
- data LogLevel
- formatLogMessage :: Loc -> LogLevel -> Text -> IO Text
- fileLocationToString :: Loc -> String
- logDebug :: Q Exp
- logInfo :: Q Exp
- logWarn :: Q Exp
- logError :: Q Exp
- logOther :: Text -> Q Exp
- loadJsYepnope :: Yesod master => Either Text (Route master) -> [Text] -> Maybe (HtmlUrl (Route master)) -> HtmlUrl (Route master)
- data ScriptLoadPosition master
- type BottomOfHeadAsync master = [Text] -> Maybe (HtmlUrl (Route master)) -> HtmlUrl (Route master)
- yesodVersion :: String
- yesodRender :: Yesod y => y -> ResolvedApproot -> Route y -> [(Text, Text)] -> Text
- module Yesod.Content
- module Yesod.Dispatch
- module Yesod.Handler
- module Yesod.Request
- module Yesod.Widget
- module Yesod.Message
Define settings for a Yesod applications. All methods have intelligent defaults, and therefore no implementation is required.
An absolute URL to the root of the application. Do not include trailing slash.
ApprootRelative. This is valid under the following
- Your application is served from the root of the domain.
- You do not use any features that require absolute URLs, such as Atom feeds and XML sitemaps.
If this is not true, you should override with a different implementation.
The encryption key to be used for encrypting client sessions.
Nothing disables sessions.
Number of minutes before a client session times out. Defaults to 120 (2 hours).
Output error response pages.
Applies some form of layout to the contents of a page.
Override the rendering function for a particular URL. One use case for this is to offload static hosting to a different domain name to avoid sending cookies.
Determine if a request is authorized or not.
Determines whether the current request is a write request. By default, this assumes you are following RESTful principles, and determines this from request method. In particular, all except the following request methods are considered write: GET HEAD OPTIONS TRACE.
This function is used to determine if a request is authorized; see
The default route for authentication.
Used in particular by
isAuthorized, but library users can do whatever
they want with it.
- No double slashes
- There is no trailing slash.
Note that versions of Yesod prior to 0.7 used a different set of rules involing trailing slashes.
Builds an absolute URL by concatenating the application root with the
pieces of a path and a query string, if any.
Note that the pieces of the path have been previously cleaned up by
|-> GHandler sub a (Maybe (Either Text (Route a, [(Text, Text)])))|
The return value is
Nothing if no storing was performed; this is the
default implementation. A
Left gives the absolute URL of the
file, whereas a
Right gives the type-safe URL. The former is
necessary when you are serving the content outside the context of a
Yesod application, such as via memcached.
The path value to set for cookies. By default, uses "/", meaning cookies will be sent to every page on the current domain.
The domain value to set for cookies. By default, the domain is not set, meaning cookies will be sent only to the current domain.
Maximum allowed length of the request body, in bytes.
Send a message to the log. By default, prints to stdout.
The logging level in place for this application. Any messages below this level will simply be ignored.
jsloader. To use yepnope: jsLoader = BottomOfHeadAsync (loadJsYepnope eyn)
Location of yepnope.js, if any. If one is provided, then all
This class is automatically instantiated when you use the template haskell mkYesod function. You should never need to deal with it directly.
|:: Yesod master|
|-> (Route sub -> Route master)|
|-> (Maybe Key -> Application)|
|-> (Route sub -> Maybe Key -> Application)|
|-> Maybe Key|
data Route a
The type-safe URLs associated with a site argument.
A type-safe, concise method of creating breadcrumbs for pages. For each resource, you declare the title of the page and the parent resource (if present).
Gets the title of the current page and the hierarchy of parent pages, along with their respective titles.
How to determine the root of the application for constructing URLs.
Note that future versions of Yesod may add new constructors without bumping
the major version number. As a result, you should not pattern match on
Return the same URL if the user is authorized to see it.
Built on top of
isAuthorized. This is useful for building page that only
contain links to pages the user is allowed to see.
Convert a widget to a
The default error handler for
Unauthorized value, with the given i18n message.