We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7914
    • 137 Posts
    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?
      • 3749
      • 24,544 Posts
      Try this:

      $modx﷓>log(xPDO::LOG_LEVEL_ERROR,"Mobile");
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting