Skip to content
Myr

Added res.local(name[, val]) docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 6b0d82f · Browse files · 1 file+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−0 removed

  • other:+17 added−0 removed

1 file+17 added−0 removed

modified:docs/guide.md+17 added
912 unmodified lines
913914 partial('movie', movie);915 // => In view: movie.director916917### res.local(name[, val])918919Get or set the given local variable _name_. The locals built up for a response are applied to those given to the view rendering methods such as `res.render()`.920921 app.all('/movie/:id', function(req, res, next){922 Movie.get(req.params.id, function(err, movie){923 // Assigns res.locals.movie = movie924 res.local('movie', movie);925 });926 });927 928 app.get('/movie/:id', function(req, res){929 // movie is already a local, however we930 // can pass more if we wish931 res.render('movie', { displayReviews: true });932 });933934### app.set(name[, val])935936Apply an application level setting _name_ to _val_, or937get the value of _name_ when _val_ is not present:
172 unmodified lines