laravel - Laravel4 -- Using wildcard subdomains, but keep the routing style of Route::controller('user', 'UserController'); -
I have to change a site to use wildcard subdomain (it's not using them anymore).
I like to use the routing style of the Root :: Controller ('User', 'User Controller');
The example of a subdomain in the docs is: But it uses the format of the I would like to get the information of the subdomain in the user control (and all other controllers, in fact) in a "larval method", if Is it a standard way to do this? Root :: Groups (array ('domain' => '{account} .myapp.com '), Function () {root :: find (' user / {id} ', function ($ account, $ id) {//});});
root :: ((user '{id}' ... . The user controls so much, And the first method handles everything, so I like it.
root :: group (array ('domain' => '{account} .myapp.com'), function () {root :: controller ('user', 'user controller ');} Path :: find (' / ',' as' => gt; 'homepages', function () {back to "my home page";}); < P> then
UserController , add the
$ account as the first parameter to your methods
Class UserController BaseController {public function extends getIndex ($ accounts) {return $ account;}}
Comments
Post a Comment