|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
cubee Smarty n00b
Joined: 16 Dec 2004 Posts: 2
|
Posted: Thu Dec 16, 2004 10:37 pm Post subject: foreach |
|
|
Hi
I have a problem with foreach. When I write in template:
Code: |
{foreach from=$blocks_page_1 item=curr}
{$curr}<br>
{/foreach}
|
PHP return me:
Code: |
Warning: preg_match() expects parameter 2 to be string, array given in xxx/smarty/Smarty_Compiler.class.php on line 1506
Fatal error: Smarty error: [in xxx/templates/index.tpl line 61]: syntax error: invalid attribute name: 'Array' (Smarty_Compiler.class.php, line 1510) in xxx/smarty/Smarty.class.php on line 1088
|
When I delete this line, all is ok.
Any ideas? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Dec 16, 2004 10:58 pm Post subject: |
|
|
is $blocks_page_1 an array? |
|
Back to top |
|
cubee Smarty n00b
Joined: 16 Dec 2004 Posts: 2
|
Posted: Fri Dec 17, 2004 12:57 pm Post subject: |
|
|
I've fixed this problem, but now I have a problem with:
Code: |
line 76: {include file="test.tpl"}
|
Code: |
Warning: preg_match() expects parameter 2 to be string, array given in /home/maresca1/public_html/libs/smarty/Smarty_Compiler.class.php on line 1506
Fatal error: Smarty error: [in /xxx/templates/index.tpl line 76]: syntax error: invalid attribute name: 'Array' (Smarty_Compiler.class.php, line 1510) in /xxx/libs/smarty/Smarty.class.php on line 1088 |
I've started receiving this problems when admin changed php to 4.3.10, and I changed Smarty to 2.6.6. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Dec 17, 2004 2:28 pm Post subject: |
|
|
Be sure to clear out your compile and cache files, and if you're using a PHP accelerator clear its files as well. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Dec 17, 2004 3:29 pm Post subject: |
|
|
php-4.3.10 triggers a bug in zend_optimizer that breaks php's foreach.
to me it looks you are bitten by that. upgrade zend-optimizer. |
|
Back to top |
|
|
|
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
|