本文整理汇总了PHP中Ak::fromJson方法的典型用法代码示例。如果您正苦于以下问题:PHP Ak::fromJson方法的具体用法?PHP Ak::fromJson怎么用?PHP Ak::fromJson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ak
的用法示例。
在下文中一共展示了Ak::fromJson方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _decodeToken
/**
* Decodes a token generated with encodeToken and returns an array of options
*
* @param string $token token options
* @param bool $url_decode should it URL decode the token true by default
* @return array Array of options for the authentication token
*/
function _decodeToken($token)
{
return (array) Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting('admin', 'token_key')));
}
示例2: _decodeToken
/**
* Decodes a token generated with encodeToken and returns an array of options
*
* @param string $token token options
* @param bool $url_decode should it URL decode the token true by default
* @return array Array of options for the authentication token
*/
function _decodeToken($token)
{
return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(AK_DEFAULT_ADMIN_SETTINGS, 'token_key')));
}
示例3: fromJson
/**
* Reads Json string in the following format:
*
* {"id":1,"first_name":"Hansi","last_name":"M\u00fcller",
* "email":"hans@mueller.com","created_at":"2008-01-01 13:01:23"}
*
* and returns an ActiveRecord Object
*
* @param string $json
* @return AkActiveRecord
*/
function fromJson($json)
{
$json = Ak::fromJson($json);
$array = Ak::convert('Object','Array',$json);
return $this->_fromArray($array);
}
示例4: decodeToken
/**
* Decodes a token generated with encodeToken and returns an array of options
*
* @param string $token token options
* @param bool $url_decode should it URL decode the token true by default
* @return array Array of options for the authentication token
*/
static function decodeToken($token)
{
return (array) Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(self::getSettingsNamespace(), 'token_key')));
}