Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

how to display specific section of a file?

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
cyletech
Smarty n00b


Joined: 06 Feb 2012
Posts: 1

PostPosted: Mon Feb 06, 2012 5:53 pm    Post subject: how to display specific section of a file? Reply with quote

hello dear,

i am new with smarty. i installed and i am using but i need to display a specific section of a file. let me say more.

this is the content of my file:
Code:
<div></div>
[IF:logged]logged in[/IF]
[IF:notlogged]not logged in[/IF]
<div></div>


now by my template engine, i can display only [IF:notlogged]...[/IF] section and after and before it but not other sections. for example i want to display the [IF:notlogged]...[/IF] section, so, the output will be:
Code:
<div></div>
not logged in
<div></div>


i want to do this by smarty, can i do that using it ?


thank you so much
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Mon Feb 06, 2012 6:05 pm    Post subject: Reply with quote

Code:
<div></div>
{if $logged}
  logged in
{else}
  not logged in
{/if}
<div></div>


Make sure $logged is assigned to the template.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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