protected function setAfterSendRoute()
    {
        if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {
            $this->afterSendRouteUrl = array('action' => $this->routeAction);

            $keys  = $this->model->getKeys();
            if (count($keys) == 1) {
                $key = reset($keys);
                if (isset($this->formData[$key])) {
                    $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID] = $this->formData[$key];
                }
            } else {
                $i = 1;
                foreach ($keys as $key) {
                    if (isset($this->formData[$key])) {
                        $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID . $i] = $this->formData[$key];
                    }
                    $i++;
                }
            }

            $this->afterSendRouteUrl['controller'] = $this->request->getControllerName();

            $find['action'] = $this->afterSendRouteUrl['action'];
            $find['controller'] = $this->afterSendRouteUrl['controller'];

            if (null == $this->menu->find($find)) {
                $this->afterSendRouteUrl['action'] = 'index';
                $this->resetRoute = true;
            }
        }
    }
protected function setAfterSendRoute()
    {
        if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {
            $this->afterSendRouteUrl = array('action' => $this->routeAction);

            $keys  = $this->model->getKeys();
            if (count($keys) == 1) {
                $key = reset($keys);
                if (isset($this->formData[$key])) {
                    $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID] = $this->formData[$key];
                }
            } else {
                $i = 1;
                foreach ($keys as $key) {
                    if (isset($this->formData[$key])) {
                        $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID . $i] = $this->formData[$key];
                    }
                    $i++;
                }
            }

            $this->afterSendRouteUrl['controller'] = $this->request->getControllerName();

            $find['action'] = $this->afterSendRouteUrl['action'];
            $find['controller'] = $this->afterSendRouteUrl['controller'];

            if (null == $this->menu->find($find)) {
                $this->afterSendRouteUrl['action'] = 'index';
                $this->resetRoute = true;
            }
        }
    }
protected function setAfterSendRoute ( ) { if ( $ this -> routeAction && ( $ this -> request -> getActionName ( ) !== $ this -> routeAction ) ) { $ this -> afterSendRouteUrl = array ( 'action' => $ this -> routeAction ) ; $ keys = $ this -> model -> getKeys ( ) ; if ( count ( $ keys ) == 1 ) { $ key = reset ( $ keys ) ; if ( isset ( $ this -> formData [ $ key ] ) ) { $ this -> afterSendRouteUrl [ \ MUtil_Model :: REQUEST_ID ] = $ this -> formData [ $ key ] ; } } else { $ i = 1 ; foreach ( $ keys as $ key ) { if ( isset ( $ this -> formData [ $ key ] ) ) { $ this -> afterSendRouteUrl [ \ MUtil_Model :: REQUEST_ID . $ i ] = $ this -> formData [ $ key ] ; } $ i ++ ; } } $ this -> afterSendRouteUrl [ 'controller' ] = $ this -> request -> getControllerName ( ) ; $ find [ 'action' ] = $ this -> afterSendRouteUrl [ 'action' ] ; $ find [ 'controller' ] = $ this -> afterSendRouteUrl [ 'controller' ] ; if ( null == $ this -> menu -> find ( $ find ) ) { $ this -> afterSendRouteUrl [ 'action' ] = 'index' ; $ this -> resetRoute = true ; } } }
Set the route destination after the mail is sent
Set the route destination after the mail is sent