本文整理匯總了PHP中TiendaHelperBase::generateSecretWord方法的典型用法代碼示例。如果您正苦於以下問題:PHP TiendaHelperBase::generateSecretWord方法的具體用法?PHP TiendaHelperBase::generateSecretWord怎麽用?PHP TiendaHelperBase::generateSecretWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TiendaHelperBase
的用法示例。
在下文中一共展示了TiendaHelperBase::generateSecretWord方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkSecretWord
/**
* Checks, if Tienda already generated a secret word. If not, it generates one
*
* @version 0.8.3
* @return boolean
*/
function checkSecretWord()
{
//if this has already been done, don't repeat
if (Tienda::getInstance()->get('checkSecretWord', '0')) {
return true;
}
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/tables');
$config = JTable::getInstance('Config', 'TiendaTable');
$config->config_name = 'secret_word';
Tienda::load('TiendaHelperBase', 'helper._base');
$config->value = TiendaHelperBase::generateSecretWord();
if ($config->save()) {
unset($config->config_id);
// Update config to say this has been done already
$config->load(array('config_name' => 'checkSecretWord'));
$config->config_name = 'checkSecretWord';
$config->value = '1';
$config->save();
return true;
}
return false;
}