public function minifyAssetsAction ()
    {
        $request = $this->getRequest();
        $siteID = $request->getPost('siteId');
        /** @var \MelisFront\Service\MinifyAssetsService $minifyAssets */
        $minifyAssets = $this->getServiceLocator()->get('MinifyAssets');
        $result = $minifyAssets->minifyAssets($siteID);

        $title = 'Compiling assets';

        /**
         * modify a little the result
         */
        $success = true;
        $message = '';
        if(!empty($result['results'])){
            foreach($result['results'] as $key => $val){
                if(!$val['success']){
                    $success = false;
                    $message = $val['message'];
                }
            }
        }

        return new JsonModel(array(
            'title' => $title,
            'message' => wordwrap($message, 20, "\n", true),
            'success' => $success,
        ));
    }
public function minifyAssetsAction ()
    {
        $request = $this->getRequest();
        $siteID = $request->getPost('siteId');
        /** @var \MelisFront\Service\MinifyAssetsService $minifyAssets */
        $minifyAssets = $this->getServiceLocator()->get('MinifyAssets');
        $result = $minifyAssets->minifyAssets($siteID);

        $title = 'Compiling assets';

        /**
         * modify a little the result
         */
        $success = true;
        $message = '';
        if(!empty($result['results'])){
            foreach($result['results'] as $key => $val){
                if(!$val['success']){
                    $success = false;
                    $message = $val['message'];
                }
            }
        }

        return new JsonModel(array(
            'title' => $title,
            'message' => wordwrap($message, 20, "\n", true),
            'success' => $success,
        ));
    }
public function minifyAssetsAction ( ) { $ request = $ this -> getRequest ( ) ; $ siteID = $ request -> getPost ( 'siteId' ) ; /** @var \MelisFront\Service\MinifyAssetsService $minifyAssets */ $ minifyAssets = $ this -> getServiceLocator ( ) -> get ( 'MinifyAssets' ) ; $ result = $ minifyAssets -> minifyAssets ( $ siteID ) ; $ title = 'Compiling assets' ; /**
         * modify a little the result
         */ $ success = true ; $ message = '' ; if ( ! empty ( $ result [ 'results' ] ) ) { foreach ( $ result [ 'results' ] as $ key => $ val ) { if ( ! $ val [ 'success' ] ) { $ success = false ; $ message = $ val [ 'message' ] ; } } } return new JsonModel ( array ( 'title' => $ title , 'message' => wordwrap ( $ message , 20 , "\n" , true ) , 'success' => $ success , ) ) ; }
Function to minify assets
Function to minify assets