Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Print 1 & Exit in My template

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
i-litovan
Smarty Rookie


Joined: 03 Aug 2013
Posts: 13

PostPosted: Tue Sep 17, 2013 6:02 am    Post subject: Print 1 & Exit in My template Reply with quote

Hi.

I have this template:

Code:


<h1>Header</hh1>
next template code
next template code
next template code
next template code

   {php}
   print 1111;
   exit();
   {/php}

next template code
next template code
next template code
next template code



I run a Smarty and get:
<h1>Header</hh1>
next template code
next template code
next template code
next template code
1111


How can I get only 1111?

--
Ivan/.
[/code]
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7256
Location: Lincoln Nebraska, USA

PostPosted: Tue Sep 17, 2013 6:42 pm    Post subject: Reply with quote

your script exits right after printing 1111.

exit();

the exit() function ceases the execution of PHP altogether, not just exiting the php script you are in.

and FWIW, don't use {php} tags at all if possible.
Back to top
View user's profile Send private message Visit poster's website
i-litovan
Smarty Rookie


Joined: 03 Aug 2013
Posts: 13

PostPosted: Sat Sep 21, 2013 12:06 pm    Post subject: Reply with quote

mohrt wrote:
your script exits right after printing 1111.

exit();

the exit() function ceases the execution of PHP altogether, not just exiting the php script you are in.

and FWIW, don't use {php} tags at all if possible.


You are right ...
Thenk you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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