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

Starter question about custom functions

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


Joined: 30 Mar 2004
Posts: 1

PostPosted: Tue Mar 30, 2004 9:41 am    Post subject: Starter question about custom functions Reply with quote

Hi there, I just started with Smarty, and I can't get custom functions like cycle or counter to work. Probably I use the wrong syntax, but this is my test.php:

<?
include('smarty/libs/Smarty.class.php');
include('smarty/libs/plugins/function.counter.php');

$smarty = new Smarty;

$smarty->template_dir = "../smarty/templates/";
$smarty->compile_dir = "../smarty/templates_c/";
$smarty->config_dir = "../smarty/configs/";
$smarty->cache_dir = "../smarty/cache/";
$smarty->plugins_dir = "smarty/libs/plugins/";

// display it
$smarty->display('test.tpl');
?>

and the test.tpl:

<html><head><title>Test</title></head>
<body>

{counter start=0 skip=1}<br>
{counter}<br>

</html>

Probably all wrong, and I guess I'm missing the general idea. Can somebody help me out here? Thnx a lot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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