How to insert a reference to a user in my entry?
[SMARTY] break out of foreach-loop
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > PHP web-programming > [SMARTY] break out of foreach-loop 25 May 2009 15:52:31

  Top users: 
  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

[SMARTY] break out of foreach-loop

Stefan Sturm 6 August 2002 12:51:19
 Hello list,

my question:

I have a foreach-loop. How can I break this loop before it ends?

Greetings,

Stefan Sturm


--
Smarty General Mailing List (http://smarty.php.­net/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Peter Billen 6 August 2002 13:38:35 permanent link ]
 break; ?

-----Original Message-----
From: Stefan Sturm [mailto:stefan@urkman.de]
Sent: dinsdag 6 augustus 2002 11:51
To: smarty-general@list­s.php.net
Subject: [SMARTY] break out of foreach-loop

Hello list,

my question:

I have a foreach-loop. How can I break this loop before it ends?

Greetings,

Stefan Sturm


--
Smarty General Mailing List (http://smarty.php.­net/)
To unsubscribe, visit: http://www.php.net/­unsub.php



--
Smarty General Mailing List (http://smarty.php.­net/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Ferdinand Beyer 6 August 2002 15:27:19 permanent link ]
 On 6 Aug 2002 at 12:38, Peter Billen wrote:
break; ?

I think that guy means a {foreach} tag inside a template :-)­.

Well the answer is easy - such a function is missing. If you really
need it (normally such logic should be in your php scripts, not in your
templates...), write your own (compiler) plugins for that.


<?php
// compiler.break.php
function smarty_compiler_bre­ak($contents, &$smarty)
{
return 'break;';
}

?>
<?php
//compiler.continue­.php
function smarty_compiler_con­tinue($contents, &$smarty)
{
return 'continue;';
}

?>

Create these two files and put them into your plugins directory
(notice the naming convention compiler.xxx.php). Now, you should
be able to leave foreach and section loops with {break} and to leave
out one step with {continue}.

--
Ferdinand Beyer
<fbeyer@clickhand.d­e>


--
Smarty General Mailing List (http://smarty.php.­net/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Guest 5 November 2008 11:37:33 permanent link ]
 YAD:-)­
Add comment
Guest 5 November 2008 11:37:43 permanent link ]
 SUPER :-P­
Add comment
Guest 27 November 2008 13:55:04 permanent link ]
 You also can use this:

{php} continue; {/php}

if you need this only one time this will best, i think

PS Sorry for my english.
Add comment
Guest 25 May 2009 15:52:31 permanent link ]
 :-)­

helpful for learning.

thanks.
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > PHP web-programming > [SMARTY] break out of foreach-loop 25 May 2009 15:52:31

see also:
RE: Farewell to Martin Poschl
Applying License, Re: ASF Board Summary…
pass tests:
see also:
Have you ever caught in such cases…
privetic
Agra

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .