Pimcore\Tool::useFrontendOutputFilters PHP Метод

useFrontendOutputFilters() публичный статический Метод

public static useFrontendOutputFilters ( Zend_Controller_Request_Abstract $request ) : boolean
$request Zend_Controller_Request_Abstract
Результат boolean
    public static function useFrontendOutputFilters(\Zend_Controller_Request_Abstract $request)
    {
        // check for module
        if (!self::isFrontend()) {
            return false;
        }
        if (self::isFrontentRequestByAdmin()) {
            return false;
        }
        // check for manually disabled ?pimcore_outputfilters_disabled=true
        if ($request->getParam("pimcore_outputfilters_disabled") && PIMCORE_DEBUG) {
            return false;
        }
        return true;
    }

Usage Example

Пример #1
1
 public function dispatchLoopShutdown()
 {
     if (!Tool::isHtmlResponse($this->getResponse())) {
         return;
     }
     if (!Tool::useFrontendOutputFilters($this->getRequest()) && !$this->getRequest()->getParam("pimcore_preview")) {
         return;
     }
     if (\Pimcore::inDebugMode()) {
         return;
     }
     if ($this->enabled) {
         include_once "simple_html_dom.php";
         $body = $this->getResponse()->getBody();
         $html = str_get_html($body);
         if ($html) {
             $html = $this->searchForScriptSrcAndReplace($html);
             $html = $this->searchForInlineScriptAndReplace($html);
             $body = $html->save();
             $html->clear();
             unset($html);
         }
         $this->getResponse()->setBody($body);
     }
 }
All Usage Examples Of Pimcore\Tool::useFrontendOutputFilters