当前位置: 首页>>代码示例>>PHP>>正文


PHP JRegistry::__toString方法代码示例

本文整理汇总了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;
 }
开发者ID:jbelborja,项目名称:lavid3,代码行数:17,代码来源:RokMiniEvents3.php

示例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);
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:51,代码来源:emails.php


注:本文中的JRegistry::__toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。