Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem with date_format ("redeclarate" ?!)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
stl134
Smarty n00b


Joined: 06 Mar 2007
Posts: 1

PostPosted: Tue Mar 06, 2007 3:32 am    Post subject: Problem with date_format ("redeclarate" ?!) Reply with quote

In the foreach, i repeat the code
"{$version[$key]->getDate()|date_format:"%d/%m/%Y"}" ...

and i receive the message:

"Fatal error: Cannot redeclare smarty_modifier_date_format() (previously declared in
c:\program files\apache group\Apache\htdocs\lib\Smarty\libs\plugins\modifier.date_format.php:30) in
c:\program files\apache group\Apache\htdocs\lib\Smarty\libs\plugins\modifier.Date_format.php on line 44"

because??!
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Mar 06, 2007 5:52 am    Post subject: Reply with quote

Are you perchance using multiple instances of the Smarty object? If so -- don't.
Back to top
View user's profile Send private message
danilo
Smarty Rookie


Joined: 07 Feb 2007
Posts: 33

PostPosted: Wed Mar 07, 2007 5:31 pm    Post subject: Reply with quote

Why not change the include / require calls to include_once / require_once?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Mar 07, 2007 6:27 pm    Post subject: Reply with quote

I just looked looked a little more closely at the original post. It is a bit of a PHP quirk.

Seems like there are two different files involved:
- modifier.Date_format.php (custom?); and
- modifier.date_format.php (shipped with Smarty).

Note the differing case. PHP sees these as two different files, even on Windows, so require/include_once can't help. Use only one of date_format or Date_format -- whichever you intend to use -- but not both.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP