7

I'm developing a custom extension that should work also in Control Panel. In an EE MSM environment I need to know which site is selected (site_id). Is there any variabile?

I can't find anything in EE Development Doc.

  • 1
    If you can, please mark my answer as being correct. It's best practice to accept the correct answer so others know. And in this case, there is no debate that the answer is correct. – Justin Kimbrell Jan 3 '13 at 15:09
20
$this->EE->config->item('site_id');

Or

config_item('site_id');
| improve this answer | |
  • 1
    I've never even seen that second syntax! Do you happen to know whether it's deprecated/official/whatever? – Adrian Macneil Jan 12 '13 at 2:13
  • 1
    @AdrianMacneil just browsed the source, it's defined in CodeIgniter and I think only references system/expressionengine/config/config.php for config items. It's also in the CI docs. Here's how a CI Reactor Engineer uses it. pretty cool. – notacouch Apr 3 '13 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.