Re: [SMARTY] Warning in Smarty 2.3.0
| From: | guido | Date: | Wed, 27 Nov 2002 17:22:19 +0000 |
| Subject: | Re: [SMARTY] Warning in Smarty 2.3.0 | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6573@lists.php.net to get a copy of this message | ||
Hello Hinrich,
If you have error reporting set to all, you will receive a ton of
warnings .. even if they aren't really problems .. so set your
reporting to not include warnings.
Wednesday, November 27, 2002, 12:02:36 PM, you wrote:
HD> Hi,
HD> I have a warning when using smarty:
HD> ---[cut]---
HD> function smarty_function_systemmessages($params, &$smarty)
HD> {
HD> // Init defaults
HD> //
HD> $result = '';
HD> // Assign all messages
HD> //
HD> if (!$smarty->messages->isEmpty()) {
HD> // Get a proper template
HD> //
HD> if (is_array($params) && array_key_exists('template',
HD> &$params))
HD> $template =& $params['template'];
HD> else
HD> $template = 'system/systemmessages.tpl';
HD> // Assign the messages
HD> //
HD> $messages = $smarty->messages->get();
HD> $smarty->assign('messages', &$messages);
HD> // Create the result
HD> //
HD> $result = $smarty->fetch(&$template);
HD> // Remove the messages
HD> //
HD> $smarty->clear_assign('messages');
HD> }
HD> if (!empty($params['assign'])) {
HD> $smarty->assign($params['assign'], $result);
HD> } else {
HD> echo $result;
HD> }
HD> }
HD> ---[cut]---
HD> I derived a class from Smarty and appended some objects. The object
HD> "messages" does store text messages with time stamps in a session. The
HD> method get collect all data from the session and assign them. Also the
HD> gotten messages are removed from the session. It is to pass some debug
HD> messages to the output.
HD> I'm using error_reporting(E_ALL). The warning is:
HD> Warning: Undefined offset: 0 in
HD> /usr/local/httpd/www.phportals.de/includes/smarty/Smarty.class.php on line
HD> 1131
HD> I'm using Smarty 2.3.0.
HD> Regards, Hinrich
--
Best regards,
guido mailto:sguido@rogers.com