public function change($id = null)
    {
        if ($id === null || !$this->Languages->exists(['id' => $id])) {
            $this->Flash->error($this->invalidRequestMessage);
            $this->redirect($this->referer());
            return;
        }
        $this->request->session()->write('contentLanguageId', (int)$id);
        $this->redirect($this->referer());
    }
public function change($id = null)
    {
        if ($id === null || !$this->Languages->exists(['id' => $id])) {
            $this->Flash->error($this->invalidRequestMessage);
            $this->redirect($this->referer());
            return;
        }
        $this->request->session()->write('contentLanguageId', (int)$id);
        $this->redirect($this->referer());
    }
public function change ( $ id = null ) { if ( $ id === null || ! $ this -> Languages -> exists ( [ 'id' => $ id ] ) ) { $ this -> Flash -> error ( $ this -> invalidRequestMessage ) ; $ this -> redirect ( $ this -> referer ( ) ) ; return ; } $ this -> request -> session ( ) -> write ( 'contentLanguageId' , ( int ) $ id ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Change action
GET

Change the content language to $id and update the session.

@param string $id The language id.
@return void
Change action GET