Hello guys,
I am using Oxid 6 with PHP version 5.6
I have a function for generating random string in a class in the file modules/moduleName/admin/function-file:
public static function generateRandomString($length = 30) {
return substr(str_shuffle(str_repeat($x=‘0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’, ceil($length/strlen($x)) )),1,$length);
}
In the same class I have other function:
public static function onActivate()
{
try {
self::generateRandomString();
self::alterTableColumns();
self::updateDBViews();
self::clearShopTmp();
$newApi = self::generateRandomString();
// var_dump($newApi);die();
} catch(Exception $e) {
oxRegistry::get("oxutilsview")->addErrorToDisplay(new oxException($e->getMessage()));
}
}
My question is: How can I pass this variable ($newApi) in the module settings in: moduleName/application/views/admin/en(de)/here_lang.php ?
E.g:
$aLang = array(
‘charset’ => ‘UTF-8’,
‘SHOP_MODULE_GROUP_name’ => ‘Something’,
‘SHOP_MODULE_configuration’ => ‘Something’,
‘SHOP_MODULE_api_key’ => ‘API Key’,
‘SHOP_MODULE_checkbox_generateApiKey’ => $here,
);
Thanks