1

I'm making a website on yii which has several separate parts, each on it's own subdomain like themes.example.com, events.example.com etc with main page example.com where these parts are listed. I will also need to authenticate users across subdomains. So i'm thinking what would be better: making each part as a yii module or making a separate yii application for each of these parts?

Lao Pdao
  • 11
  • 1

2 Answers2

0

I think in your case it would be better to use modules. At least to have a single webroot directory. Using separate yii application would be appropriate for console part of your project. See this link for more information: The directory structure of the Yii project site

Oleg
  • 7,070
  • 4
  • 47
  • 49
-1

Well,

The features you are trying to accomplish from Yii its called "Parameterizing Hostnames". You need to create a module based structure in Yii.

At first you need to create a virtual host from apache and redirect that to your Yii project. On you Yii framework you need to change the URL manager from config.

'components' => array(
   ...
   'urlManager' => array(
      'rules' => array(
         'http://admin.example.com' => 'admin/site/index',
         'http://admin.example.com/login' => 'admin/site/login',
      ),
   ),
   ...
),

To know more about Parameterizing Hostnames

Hasanavi
  • 8,455
  • 2
  • 29
  • 35