Categories > TinyButStrong general >

Confused. How do I use this?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Val
Date: 2006-02-24
Time: 17:33

Confused. How do I use this?

I am at a loss here...
Typically, I use EditPlus on my local machine for html and php rolled into one document.  Then I load my *.php file up to my server and voila!

Do I continue to use Edit Plus locally, but now have 2 documents open -
the html document and the php document?  And somehow, magically, these get rolled into one on the server by including TBS?

I'm sorry, I'm really confused about this.
By: Skrol29
Date: 2006-02-24
Time: 17:45

Re: Confused. How do I use this?

Hi Val,

Yes that's rigth. The point is that the PHP file (the script) will load the HTML file contents (the template) into a string, and then it will work on this string, and output the result to the client.

Typically, the template is an HTML file, but you can give the extension you want that is no matter. It can be ".html", ".txt", ".tpl", even ".php",...

If your PHP application has several pages, you can also have only one PHP file managing several HTML files.

By: Val
Date: 2006-02-24
Time: 18:35

Re: Confused. How do I use this?

Thank you!  I'll see if I can do this...
By: TomH
Date: 2006-02-25
Time: 00:41

Re: Confused. How do I use this?

Val, it will be worth the effort, I am new to TBS and am amazed at how much it has sped up and simplified at the same time.
FWIW - here's how I approach converting to TBS
(1) Reorganize existing application page(s)  as follows
(a) remove all echo stmts and stuff results into $vars
(b) move php to top of file, html to bottom
<?php
while($array as $key -> $val){
echo "<a href="$key">$name</a>";
}
$var = "some fancy processing here";
?>
<table><tr><td>
<?
echo $var;
?>
</td></tr></table>
You get the idea.

The above becomes:
<?php
while($array as $key -> $val){
$listnames .= "<a href="$key">$name</a>";
}
$var = "some fancy processing here";
// learn yo use the heredoc form of output
$output <<<EOD
My manes are $names
<table><tr><td>
$var;
</td></tr></table>
EOD;
?>

Now you're ready...to do TBS
Go through _every_ one of Skrol29's Examples at
  http://www.tinybutstrong.com/examples.php
  (a) pick an example (start at the top, they increase in complexity)
  (b) select each of the "Display" radio buttons, one at a time
  (c) smile as you learn how easy TBS is to use

HTH
By: Val
Date: 2006-02-25
Time: 13:09

Re: Confused. How do I use this?

Tom, thank you!  i'll work through the examples.