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: Root :: Groups (array ('domain' => '{account} .myapp.com '), Function () {root :: find (' user / {id} ', function ($ account, $ id) {//});});

But it uses the format of the root :: ((user '{id}' ... . The user controls so much, And the first method handles everything, so I like it.

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 :: 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

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -