mirror of
https://github.com/expressjs/expressjs.com.git
synced 2026-02-26 02:54:58 +00:00
17 lines
517 B
Plaintext
17 lines
517 B
Plaintext
section
|
|
h3(id='res.render') res.render(view, [locals], callback)
|
|
|
|
p.
|
|
Render a <code>view</code> with a callback responding with
|
|
the rendered string. When an error occurs <code>next(err)</code>
|
|
is invoked internally. When a callback is provided both the possible error
|
|
and rendered string are passed, and no automated response is performed.
|
|
|
|
+js.
|
|
app.render('index', function(err, html){
|
|
// ...
|
|
});
|
|
|
|
app.render('user', { name: 'Tobi' }, function(err, html){
|
|
// ...
|
|
}); |