src/Controller/MelisFlashMessengerController.php
public function getflashMessageAction()
    {
        // translator service
        $translator = $this->serviceLocator->get('translator');

        // tool service
        $tool = $this->getServiceLocator()->get('MelisCoretool');
        
        // flash messenger service
        $flashMessenger = $this->getServiceLocator()->get('MelisCoreFlashMessenger');
        
        $flashMessages = Json::decode($flashMessenger->getFlashMessengerMessages());
        
        // flashMessages array, re-stored so we can apply translation to its content
        $fmArray = array();
        $fmCtr = 0;
        
        if($flashMessages)
        {
            foreach($flashMessages as $fmKey => $fmValues) {
                $title   = $translator->translate($fmValues->title);
                $message =  $translator->translate($fmValues->message);
                $fmArray[] = array(
                    'title' => ($title),
                    'message' => ($message),
                    'image' => $fmValues->image,
                    'time' => $fmValues->time,
                    'date' => $fmValues->date,
                    'date_trans' => $fmValues->date_trans,
                );
            }
        }
        
    	return new JsonModel(array(
    		'flashMessage' => $fmArray,
    	));
    }
public function getflashMessageAction()
    {
        // translator service
        $translator = $this->serviceLocator->get('translator');

        // tool service
        $tool = $this->getServiceLocator()->get('MelisCoretool');
        
        // flash messenger service
        $flashMessenger = $this->getServiceLocator()->get('MelisCoreFlashMessenger');
        
        $flashMessages = Json::decode($flashMessenger->getFlashMessengerMessages());
        
        // flashMessages array, re-stored so we can apply translation to its content
        $fmArray = array();
        $fmCtr = 0;
        
        if($flashMessages)
        {
            foreach($flashMessages as $fmKey => $fmValues) {
                $title   = $translator->translate($fmValues->title);
                $message =  $translator->translate($fmValues->message);
                $fmArray[] = array(
                    'title' => ($title),
                    'message' => ($message),
                    'image' => $fmValues->image,
                    'time' => $fmValues->time,
                    'date' => $fmValues->date,
                    'date_trans' => $fmValues->date_trans,
                );
            }
        }
        
    	return new JsonModel(array(
    		'flashMessage' => $fmArray,
    	));
    }
public function getflashMessageAction ( ) { // translator service $ translator = $ this -> serviceLocator -> get ( 'translator' ) ; // tool service $ tool = $ this -> getServiceLocator ( ) -> get ( 'MelisCoretool' ) ; // flash messenger service $ flashMessenger = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreFlashMessenger' ) ; $ flashMessages = Json :: decode ( $ flashMessenger -> getFlashMessengerMessages ( ) ) ; // flashMessages array, re-stored so we can apply translation to its content $ fmArray = array ( ) ; $ fmCtr = 0 ; if ( $ flashMessages ) { foreach ( $ flashMessages as $ fmKey => $ fmValues ) { $ title = $ translator -> translate ( $ fmValues -> title ) ; $ message = $ translator -> translate ( $ fmValues -> message ) ; $ fmArray [ ] = array ( 'title' => ( $ title ) , 'message' => ( $ message ) , 'image' => $ fmValues -> image , 'time' => $ fmValues -> time , 'date' => $ fmValues -> date , 'date_trans' => $ fmValues -> date_trans , ) ; } } return new JsonModel ( array ( 'flashMessage' => $ fmArray , ) ) ; }
Returns the flash messages content
@return \Zend\View\Model\JsonModel
Returns the flash messages content