Categories > TinyButStrong general >

still can't get it to work

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: alme1304
Date: 2008-12-16
Time: 15:27

still can't get it to work

hello,
i've been trying to get tbs to work but I either see exacly what im typing (e.g [var.x]) or an error when I open the php file. Here is what I have

PHP side
<?php

include_once('tbs_class_php5.php') ;

$x = 'Hello World';

$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('1.htm') ;
$TBS->Show() ;

?>
and my HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TinyButStrong</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="tbs_us_examples_0styles.css" rel="stylesheet" type="text/css">
</head>
<body>

<div align="center" class="title-page">
  [var.x]
</div>

</body>
</html>

As you can see I have clearly copied and pasted the examples but I still can't see anything. Any suggestions?
Thank you in advance
By: TomH
Date: 2008-12-16
Time: 18:20

Re: still can't get it to work

Hello alme,

Sorry to be the bearer of bad news, but...
I cut and pasted your code and it works perfectly!

By: Skrol29
Date: 2008-12-16
Time: 18:23

Re: still can't get it to work

Hi,

But what is the error message?
By: alme1304
Date: 2008-12-16
Time: 18:41

Re: still can't get it to work

the php file says

TinyButStrong Error with LoadTemplate() method : file '1.htm' is not found or not readable.

and the html file displays
[var.x]
By: alme1304
Date: 2008-12-16
Time: 19:14

Re: still can't get it to work

sorry for the double post.
could it be that im installing wrong somehow?
I just put a copy of the tbs_class_php5.php on my www, is that all?
By: TomH
Date: 2008-12-16
Time: 23:31

Re: still can't get it to work

The error message means the .php file cannot find the .htm file based on the current configuration of files and directories.

Generally speaking... based on your .php file code, the .php file and the template (the .htm file) would need to be in the same directory as the .php file.

If you want to do otherwise you need to alter your
$TBS->LoadTemplate('some/different/path/1.htm') ;

The overall process of using TBS goes like...
(1) you do your page link to the .php file...
(2) which then loads the TBS class, does any wanted database connection, etc,
(3) and also loads  and parses the .htm template with TBS->LoadTemplate(), which is analogous to an 'include' with super-powers
(4) finally pushing out the results with the $TBS->Show(), which does the remaining TBS block processing and more

Hope that helps,
TomH
By: alme1304
Date: 2008-12-17
Time: 01:50

Re: still can't get it to work

they are on same folder, by any chance do i have to have PEAR enabled
By: TomH
Date: 2008-12-17
Time: 05:03

Re: still can't get it to work

No, PEAR is not required.

As I mentioned earlier, I cut/pasted your "exact" code and it worked as expected.

Is your html file named 1.htm -or- 1.html ? Just seems that if the files are in the same folder then there's a naming problem!

By: alme1304
Date: 2008-12-19
Time: 20:40

Re: still can't get it to work

ok I've got it to work
seems like all I had to do was go to the php file instead of the html file.
I thought i tried that already, but whatever
Thanks to all the contributed