protected function _afterSave(EntityInterface $comment)
    {
        $successMessage = $this->config('successMessage');
        if (is_callable($successMessage)) {
            $successMessage = $successMessage($comment, $this->_controller);
        }

        $this->_controller->Flash->success($successMessage, ['key' => 'commentsForm']);
        if ($this->config('redirectOnSuccess')) {
            $redirectTo = $this->config('redirectOnSuccess') === true ? $this->_controller->referer() : $this->config('redirectOnSuccess');
            $this->_controller->redirect($redirectTo);
        }
    }
protected function _afterSave(EntityInterface $comment)
    {
        $successMessage = $this->config('successMessage');
        if (is_callable($successMessage)) {
            $successMessage = $successMessage($comment, $this->_controller);
        }

        $this->_controller->Flash->success($successMessage, ['key' => 'commentsForm']);
        if ($this->config('redirectOnSuccess')) {
            $redirectTo = $this->config('redirectOnSuccess') === true ? $this->_controller->referer() : $this->config('redirectOnSuccess');
            $this->_controller->redirect($redirectTo);
        }
    }
protected function _afterSave ( EntityInterface $ comment ) { $ successMessage = $ this -> config ( 'successMessage' ) ; if ( is_callable ( $ successMessage ) ) { $ successMessage = $ successMessage ( $ comment , $ this -> _controller ) ; } $ this -> _controller -> Flash -> success ( $ successMessage , [ 'key' => 'commentsForm' ] ) ; if ( $ this -> config ( 'redirectOnSuccess' ) ) { $ redirectTo = $ this -> config ( 'redirectOnSuccess' ) === true ? $ this -> _controller -> referer ( ) : $ this -> config ( 'redirectOnSuccess' ) ; $ this -> _controller -> redirect ( $ redirectTo ) ; } }
Logic triggered after comment was successfully saved.

@param \Cake\Datasource\EntityInterface $comment Comment that was just saved
@return void
Logic triggered after comment was successfully saved .