How to include php functions/codes in tpl files?

  • Hello, I'm using WS 3 and want to include some php functions/codes in tpl files. How can I do that?

    Assume I want to show server time in footer (/templates/pageFooterCopyright.tpl), I've added something I've googled (I could not find which code I've added unfortunately) that did not work. That code called $date function, I think that was <?php $date ?> or something like this.

    Also this is the code I added to global.php:

    Code
    // Date
    $date = date('l jS \of F Y h:i:s A');

    Also I've tried this:

    Code
    {php} //code here{/php}

    But that did not work either.

    Could you please help me?

    Regards

  • Thanks Alexander, so you mean there's no need to add any code to global.php for this mean. That's great.

    Then what if I want to add some custom codes and then call in tpl files?

    Would you please guide me in this case?

    I've googled but seems they did not the trick.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!