diff --git a/_includes/api/en/3x/app-render.md b/_includes/api/en/3x/app-render.md index 0b1ced84c8..4acf2a1d36 100644 --- a/_includes/api/en/3x/app-render.md +++ b/_includes/api/en/3x/app-render.md @@ -4,6 +4,11 @@ Render a `view` with a callback responding with the rendered string. This is the app-level variant of `res.render()`, and otherwise behaves the same way. +The `view` argument can be an absolute path or a path relative to the `views` setting. +If the path does not contain a file extension, then the `view engine` setting determines +the file extension. For example, with `app.set('views', './views')` and +`app.set('view engine', 'pug')`, `app.render('email', ...)` renders `./views/email.pug`. + ```js app.render('email', function (err, html) { // ... diff --git a/_includes/api/en/4x/app-render.md b/_includes/api/en/4x/app-render.md index 8e35207ebd..4f62499faa 100644 --- a/_includes/api/en/4x/app-render.md +++ b/_includes/api/en/4x/app-render.md @@ -4,6 +4,12 @@ Returns the rendered HTML of a view via the `callback` function. It accepts an o that is an object containing local variables for the view. It is like [res.render()](#res.render), except it cannot send the rendered view to the client on its own. +The `view` argument is resolved the same way as in [res.render()](#res.render): it can +be an absolute path or a path relative to the `views` setting. If the path does not +contain a file extension, then the `view engine` setting determines the file extension. +For example, with `app.set('views', './views')` and `app.set('view engine', 'pug')`, +`app.render('email', ...)` renders `./views/email.pug`. +