|
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 |
lesmith Smarty Rookie
Joined: 19 Sep 2003 Posts: 34
|
Posted: Sun Oct 05, 2003 10:54 pm Post subject: function |
|
|
How do i use my custom function.
ie hello world.
function hello_world(){
$hello = "hello world";
}
hello_world();
$tpl->assign("hello", $hello);
I know this is basic but im getting confued.
Help if you can
Thank you |
|
Back to top |
|
mikeken Smarty Regular
Joined: 13 Aug 2003 Posts: 57 Location: MN
|
Posted: Sun Oct 05, 2003 11:38 pm Post subject: |
|
|
Um, well, this is more php related, checkout http://php-forums.com for help on php directly.
But here we go.
Code: |
function hello_world(){
$hello = "hello world";
return $hello;
}
$var = hello_world();
$tpl->assign("hello",$var);
|
There ya go, look on google for tutorials on php functions. |
|
Back to top |
|
lesmith Smarty Rookie
Joined: 19 Sep 2003 Posts: 34
|
Posted: Sun Oct 05, 2003 11:42 pm Post subject: |
|
|
Thanks
But I had just worked it out. Im a little rusty t php. Just forgot to call my return
Thanks for the help tho |
|
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
|