Garak plugin for CakePHP3

0.1.4 2016-11-24 06:40 UTC


Recentry, the amount of feature phones are decreasing, though they are still existing. Sometimes, we have to handle them, but there are some obstacles. First, we can't use cookie to keep session. Furthermore, the character code is not UTF-8 but SJIS.

This plugin will deal with the problems mentioned above.


You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require gorogoroyasu/garak


just add few lines in AppController and bootstrap.php.

// in bootstrap.php
Plugin::load('Garak', ['bootstrap' => true]);

// in AppController.php
public function initialize()

public function beforeRedirect(Event $Event, $url, Response $response)
    $url = $this->Garak->generateRedirectUrl($url);

// The line below was the wrong statement. 
// public function redirect($url, $status = null, $exit = true)
// {
//     $url = $this->Garak->generateRedirectUrl($url);
//    parent::redirect($url, $status, $exit);


I recommend you to user Themed ( to switch the view. You can identify if the type of device by using isGarak method in Garak.Garak.