Jarves\PageStack::isAdmin PHP Method

isAdmin() public method

When a route is loading within /jarves
public isAdmin ( ) : boolean
return boolean
    public function isAdmin()
    {
        $adminPrefix = $this->adminPrefix;
        if ('/' === substr($adminPrefix, -1)) {
            $adminPrefix = substr($adminPrefix, 0, -1);
        }
        if (!$this->getRequest()) {
            return false;
        }
        return 0 === strpos($this->getRequest()->getPathInfo(), $adminPrefix);
    }

Usage Example

 public function onFinishRequestPre(FinishRequestEvent $event)
 {
     if ($event->getRequestType() !== HttpKernelInterface::MASTER_REQUEST) {
         return;
     }
     $key = $this->pageStack->isAdmin() ? 'backend' : 'frontend';
     $this->log($key, microtime(true) - $this->start);
 }
All Usage Examples Of Jarves\PageStack::isAdmin