I am creating a "gateway" plugin and I don’t think I have a clear understanding of how it is working.
Here is what I am using:
<?php
if( $modx->context->get('key') != "mgr" )
{
switch ($modx->getOption('http_host')) {
case 'local.m.mysite.com:80':
case 'local.m.mysite.com':
// if the http_host is of a specific domain, switch the context
error_log('mobile');
$modx->switchContext('mobile');
break;
default:
// by default, don't do anything
break;
}
}
I am attaching the plugin to "OnHandleRequest" - I am not seeing my message in my error log - should I be? Or does it not work like that?