We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17546
    • 75 Posts
    Hello,

    Which function is used to know if the user is under the front or backend, does this function exist.

    Low
      Low
      • 22295
      • 153 Posts
      $modx->context->get(’key’) to get the context key.


      if you want to know this when rendering a resource, for example - then look at
      $resource->_contextKey
      which is actually populated in the modresource.clas.php by:
      $this->_contextKey= isset ($this->xpdo->context) ? $this->xpdo->context->get(’key’) : ’web’;