PDA

View Full Version : fasttemplates


Xavior
05-10-2003, 22:41
i am sure most of the guys here have heard about class.fasttemplates.php3
do you guys know where i can download it?
i want to try this script out... (eh.. it's kinda like a script so.. heh..)
it would be so much easier for me to edit my webpages.. so yah... pls help..

userguy
05-10-2003, 22:48
Sure :) Look for here: http://www.thewebmasters.net/php/ Hope it helps :D

Xavior
05-10-2003, 23:06
thanks so much :)

Xavior
09-10-2003, 21:01
Fatal error: Cannot redeclare clear_parse() in class.FastTemplate.php3 on line 636
argh.. i am getting this error.. what could haf caused it??

userguy
10-10-2003, 12:02
Perhaps you forgot to parse the name of the constant inside the echo? Maybe you could post the part of the script here :)

Xavior
11-10-2003, 14:19
i am using the examples that they gave me..
so i guess it should be off no problem?
sigh~!
maybe i test it out with my own examples and see how it goes first..

userguy
11-10-2003, 14:30
I am not that sure too since I haven't used the script before. You might want to take a look at this to compare with what you have:

<?
include 'class.FastTemplate.php3';
$model = FastTemplate('d:\site\php_teste\modelos');
$model-> define (array ( '
pagina' => 'teste.html' ));

$greeting = 'Teste ! Classe FastTemplate)';
$model->assign(array('{ANYTHING}'=>$greeting));
$model->parse('PAGINA','pagina');
$model->FastPrint('PAGINA');

?>

Xavior
11-10-2003, 14:40
some how.. i believe it's an error conflict between the server and the script... =x

userguy
11-10-2003, 14:45
Perhaps...let us know if there is any progress on the situation. I will continue looking out for solutions :)

Xavior
11-10-2003, 14:59
i do believe it's script error..
is anyone else here testing the same script?
pls let me know if there's the same error...
i tried the example from
http://www.phpbuilder.com/columns/sascha19990316.php3
and i got the error..
Parse error: parse error in test.php on line 5

userguy
11-10-2003, 15:12
Perhaps you want to try another example from DevShed: http://www.devshed.com/Server_Side/PHP/WebDevWithFastTemplate :)

Xavior
11-10-2003, 15:43
still getting the error
Fatal error: Cannot redeclare clear_parse() in class.FastTemplate.php3 on line 636

userguy
11-10-2003, 16:08
I believe it is something to do with the PHP version your hosting provider has. FastTemplates is designed for use on PHP3 and repatched to work on earlier versions on PHP4 but I believe your host might be using the latest version of PHP. You might want to read this thread for more information: http://www.phpbuilder.com/board/showthread.php?threadid=10228973 and changed to using Smarty Templating Engine instead :)

Xavior
11-10-2003, 22:27
-.-
no wonder...
LOL
downloaded smarty.. and am trying out ...
hope it works... and would work well for me.. :)

userguy
11-10-2003, 22:30
I hope that it would work well for you too. Let me know if you discover anything interesting :)

Xavior
11-10-2003, 22:40
well.. for one.. smarty is actually supported by php.net
hmm... and they never did place it inside the main lib for php? how strange..

userguy
11-10-2003, 22:46
Yup...but they did place it under 'PHP: A Tourist's Guide' section of their site but I wonder why they decided not to include it in the main library for PHP :)

Xavior
24-10-2003, 07:30
erm.. needed some help with smarty..
they are using mysql.class.php
but somehow.. i cant find that class..
and i am using the foreach smarty function to deal with the mysql results...
and i just cant seem to get it working...
it just gave me lots of "r"'s

here's what i did...
//----news.php----//
function get_news() {
global $tpl;
$news = "SELECT * FROM news LIMIT 5";
$news = mysql_query($news);
$tpl->assign("news_list","$news");
}
//----news.tpl----//

{foreach item="news" from=$news_list}
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" width="100%">
<tr><td>No: {$news.id} </td>
<td>Title: {$news.title} </td></tr><tr>
<td colspan="2">Posted by: {$news.author} on {$news.timestamp}</td>
</tr><tr><td colspan="2"><br>{$news.body}</td></tr></table>
{/foreach}