|
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 |
smartflower2002 Smarty n00b
Joined: 21 Apr 2010 Posts: 2
|
Posted: Wed Apr 21, 2010 7:40 pm Post subject: Hey guys beginner question |
|
|
hi guys, i am making a php script and i thought to use smarty.
so can u please give me a nice tutorial to use smaty.
and second thing.
how to use php functions in smarty.eg
$test = true;
if $test
{
echo "its true";
}
else
{
echo "its false";
}
now incase if i want to use that $true in smarty how can i?
please and thanks |
|
Back to top |
|
waro Smarty Regular
Joined: 12 Jun 2008 Posts: 38
|
Posted: Thu Apr 22, 2010 8:17 am Post subject: |
|
|
I use this crash course when I first learn about Smarty. And the manual is also a great help too. |
|
Back to top |
|
surendran Smarty n00b
Joined: 22 Apr 2010 Posts: 3
|
Posted: Thu Apr 22, 2010 11:47 am Post subject: |
|
|
$smarty->assign('value' , $true);
in smarty as
{$value} |
|
Back to top |
|
smartflower2002 Smarty n00b
Joined: 21 Apr 2010 Posts: 2
|
Posted: Thu Apr 22, 2010 5:02 pm Post subject: |
|
|
hmm, crash course doesnt solve my querry.
i need to use function in if statement. |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Thu Apr 22, 2010 5:40 pm Post subject: |
|
|
smartflower2002 wrote: | hmm, crash course doesnt solve my querry.
i need to use function in if statement. |
i don't understand your first post. there is no function there.
do you want to use an if statement?
http://www.smarty.net/manual/en/language.function.if.php |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Apr 22, 2010 11:57 pm Post subject: |
|
|
Code: | $smarty->assign('test',true); |
Code: | {if $test}
its true
{else}
its false
{/if} |
|
|
Back to top |
|
Kim Steinhaug Smarty n00b
Joined: 26 Apr 2010 Posts: 3
|
Posted: Mon Apr 26, 2010 11:17 am Post subject: |
|
|
Directly in the template, you could do this:
Code: | {assign var='test' value='1'}
{if $test}
{else}
{/if} |
Regards,
Kim Steinhaug |
|
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
|