* get controller instance * @param {String} name * @param {String} m
(name, m = this.ctx.module)
| 232 | * @param {String} m |
| 233 | */ |
| 234 | controller(name, m = this.ctx.module) { |
| 235 | let mcls = think.app.controllers; |
| 236 | if (this.ctx.app.modules.length) { |
| 237 | mcls = think.app.controllers[m || 'common'] || {}; |
| 238 | } |
| 239 | const Cls = mcls[name]; |
| 240 | assert(Cls, `can not find controller: ${name}`); |
| 241 | return new Cls(this.ctx); |
| 242 | }, |
| 243 | /** |
| 244 | * get service |
| 245 | * @param {String} name |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…