本文整理汇总了PHP中JRegistry::__toString方法的典型用法代码示例。如果您正苦于以下问题:PHP JRegistry::__toString方法的具体用法?PHP JRegistry::__toString怎么用?PHP JRegistry::__toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRegistry
的用法示例。
在下文中一共展示了JRegistry::__toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEvents
public function getEvents(JRegistry &$params)
{
$conf = JFactory::getConfig();
if ($conf->get('caching') && $params->get('module_cache')) {
$user = JFactory::getUser();
$cache = JFactory::getCache('mod_rokminievents3');
$cache->setCaching(true);
$args = array($params);
$checksum = md5($params->__toString());
$events = $cache->get(array($this, '_getEvents'), $args, 'mod_rokminievents3-' . $user->get('aid', 0) . '-' . $checksum);
} else {
$events = $this->_getEvents($params);
}
$events = $this->setTimezone($params, $events);
$events = $this->trimDescription($params, $events);
return $events;
}
示例2: save
/**
* Save method is diff here because we're writing to a file
* (non-PHPdoc)
* @see Citruscart/admin/CitruscartController::save()
*/
function save()
{
$app = JFactory::getApplication();
$id = $app->input->get('id', 'en-GB');
$temp_values = $app->input->getArray($_POST);
$model = $this->getModel('Emails', 'CitruscartModel');
// Filter values
$prefix = $model->email_prefix;
$values = array();
foreach ($temp_values as $k => $v) {
if (stripos($k, $prefix) === 0) {
$values[$k] = $v;
}
}
$lang = $model->getItem($id);
$path = $lang->path;
$msg = JText::_('COM_CITRUSCART_SAVED');
jimport('joomla.filesystem.file');
if (JFile::exists($path)) {
$original = new JRegistry();
$original->loadFile($path);
$registry = new JRegistry();
$registry->loadArray($values);
$original->merge($registry);
$txt = $original->__toString('INI');
$success = JFile::write($path, $txt);
if (!$success) {
$msg = JText::_('COM_CITRUSCART_ERROR_SAVING_NEW_LANGUAGE_FILE');
}
}
$model->clearCache();
//$task = JRequest::getVar('task');
$task = $app->input->getString('task');
$redirect = "index.php?option=com_citruscart";
switch ($task) {
case "apply":
$redirect .= '&view=' . $this->get('suffix') . '&task=edit&id=' . $id;
break;
case "save":
default:
$redirect .= "&view=" . $this->get('suffix');
break;
}
$redirect = JRoute::_($redirect, false);
$this->setRedirect($redirect, $this->message, $this->messagetype);
}