Author Topic: Using Your Own Function's in smary.  (Read 422 times)

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Using Your Own Function's in smary.
« on: July 07, 2009, 04:38:39 AM »
Hey,

I wanna know if you can use your own functions in smarty if yes how?... for example.
I have a format function for time.
Code: [Select]
<?php
//some sql to select usersonline..
//some while query.
//time is here now
echo format_time(time() - $player['last_seen']);
//would show like 1 second ago.
?>

So how would i use my functions in smarty?
Thanks!
Crazy-T

Offline travo

  • Level 18
  • *
  • Posts: 186
  • Reputation: +2/-0
    • View Profile
Re: Using Your Own Function's in smary.
« Reply #1 on: July 07, 2009, 04:47:34 AM »
Assign to a variable the result of your function, or write a plugin. Details of how to write them are on the Smarty site.

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Using Your Own Function's in smary.
« Reply #2 on: July 07, 2009, 04:15:49 PM »
Ok thankyou :)!
Crazy-T

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal