undefined method yii\helpers\Json::htmlEncode

Kindly assist the newbie. I generated a form in gii and now i get the error below.

PHP Fatal Error – yii\base\ErrorException

Call to undefined method yii\helpers\Json::htmlEncode()

1. in C:\xampp\htdocs\ivsmis\vendor\yiisoft\yii2-jui\Widget.php at line 77


68697071727374757677787980818283848586





 


    /**


     * Registers a specific jQuery UI widget options


     * @param string $name the name of the jQuery UI widget


     * @param string $id the ID of the widget


     */


    protected function registerClientOptions($name, $id)


    {


        if ($this->clientOptions !== false) {


            $options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);


            $js = "jQuery('#$id').$name($options);";


            $this->getView()->registerJs($js);


        }


    }


 


    /**


     * Registers a specific jQuery UI widget events


     * @param string $name the name of the jQuery UI widget


     * @param string $id the ID of the widget





2. yii\base\ErrorHandler::handleFatalError()

$_SERVER = [

'MIBDIRS' => 'C:/xampp/php/extras/mibs',


'MYSQL_HOME' => '\\xampp\\mysql\\bin',


'OPENSSL_CONF' => 'C:/xampp/apache/bin/openssl.cnf',


'PHP_PEAR_SYSCONF_DIR' => '\\xampp\\php',


'PHPRC' => '\\xampp\\php',


'TMP' => '\\xampp\\tmp',


'HTTP_HOST' => 'localhost',


'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0',


'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',


'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5',


'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',


'HTTP_REFERER' => 'http://localhost/ivsmis/web/index.php/registration/index',


'HTTP_COOKIE' => '9a4615efd33c6ce1fd08343197db186b=7ef60ef78be98500a3f1db08243de4c9d88c9715a%3A4%3A%7Bi%3A0%3Bs%3A5%3A%22admin%22%3Bi%3A1%3Bs%3A5%3A%22admin%22%3Bi%3A2%3Bi%3A2592000%3Bi%3A3%3Ba%3A0%3A%7B%7D%7D; 4194848e50751f7d64a486eeccc709d8=7ef60ef78be98500a3f1db08243de4c9d88c9715a%3A4%3A%7Bi%3A0%3Bs%3A5%3A%22admin%22%3Bi%3A1%3Bs%3A5%3A%22admin%22%3Bi%3A2%3Bi%3A2592000%3Bi%3A3%3Ba%3A0%3A%7B%7D%7D; 61032df111921a5a388c77c45f79afe5=338ff3eb60ab194ec5790f82bd4dffd5817755a7a%3A4%3A%7Bi%3A0%3Bs%3A5%3A%22admin%22%3Bi%3A1%3Bs%3A5%3A%22admin%22%3Bi%3A2%3Bi%3A2592000%3Bi%3A3%3Ba%3A0%3A%7B%7D%7D; _identity=ed43cb0bf30dd290ae10e9fe03a3c8b26986f14abe14d6e00d8d0a7980d3ef8as%3A28%3A%22%5B%22100%22%2C%22test100key%22%2C2592000%5D%22%3B; _csrf=9757d59c70cafc8bc5c882b3f05b4f0d444d27d42afc6c1771965b961e0631fes%3A32%3A%22EZGFYm999yhjhutPZTbztj51nDPckrKv%22%3B',


'HTTP_CONNECTION' => 'keep-alive',


'HTTP_CACHE_CONTROL' => 'max-age=0',


'PATH' => 'C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\xampp\\php;',


'SystemRoot' => 'C:\\Windows',


'COMSPEC' => 'C:\\Windows\\system32\\cmd.exe',


'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',


'WINDIR' => 'C:\\Windows',


'SERVER_SIGNATURE' => '

Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3 Server at localhost Port 80

',

'SERVER_SOFTWARE' => 'Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3',


'SERVER_NAME' => 'localhost',


'SERVER_ADDR' => '::1',


'SERVER_PORT' => '80',


'REMOTE_ADDR' => '::1',


'DOCUMENT_ROOT' => 'C:/xampp/htdocs',


'REQUEST_SCHEME' => 'http',


'CONTEXT_PREFIX' => '',


'CONTEXT_DOCUMENT_ROOT' => 'C:/xampp/htdocs',


'SERVER_ADMIN' => 'postmaster@localhost',


'SCRIPT_FILENAME' => 'C:/xampp/htdocs/ivsmis/web/index.php',


'REMOTE_PORT' => '49307',


'GATEWAY_INTERFACE' => 'CGI/1.1',


'SERVER_PROTOCOL' => 'HTTP/1.1',


'REQUEST_METHOD' => 'GET',


'QUERY_STRING' => '',


'REQUEST_URI' => '/ivsmis/web/index.php/registration/create',


'SCRIPT_NAME' => '/ivsmis/web/index.php',


'PATH_INFO' => '/registration/create',


'PATH_TRANSLATED' => 'C:\\xampp\\htdocs\\registration\\create',


'PHP_SELF' => '/ivsmis/web/index.php/registration/create',


'REQUEST_TIME_FLOAT' => 1159979802.47399997711181640625,


'REQUEST_TIME' => 1159979802,

];

$_COOKIE = [

'9a4615efd33c6ce1fd08343197db186b' => '7ef60ef78be98500a3f1db08243de4c9d88c9715a:4:{i:0;s:5:"admin";i:1;s:5:"admin";i:2;i:2592000;i:3;a:0:{}}',


'4194848e50751f7d64a486eeccc709d8' => '7ef60ef78be98500a3f1db08243de4c9d88c9715a:4:{i:0;s:5:"admin";i:1;s:5:"admin";i:2;i:2592000;i:3;a:0:{}}',


'61032df111921a5a388c77c45f79afe5' => '338ff3eb60ab194ec5790f82bd4dffd5817755a7a:4:{i:0;s:5:"admin";i:1;s:5:"admin";i:2;i:2592000;i:3;a:0:{}}',


'_identity' => 'ed43cb0bf30dd290ae10e9fe03a3c8b26986f14abe14d6e00d8d0a7980d3ef8as:28:"["100","test100key",2592000]";',


'_csrf' => '9757d59c70cafc8bc5c882b3f05b4f0d444d27d42afc6c1771965b961e0631fes:32:"EZGFYm999yhjhutPZTbztj51nDPckrKv";',

];

Yii Framework

2006-10-04, 18:36:43

Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3

Yii Framework/2.0.2

Method Json::htmlEncode() has been added in 2.0.4. Apparently you’ve got 2.0.2. Update your Yii.